Associative Array mit VARCHAR2 als Referenz
Tipp 61
Thema: DEKLARATION
Datenbank-Version: RDBMS 8.x
Erstellt am 07.10.19
Bearbeitet am 07.10.19
SET SERVEROUTPUT ON
DECLARE
TYPE country_tab_type IS TABLE OF VARCHAR2(50)
INDEX BY VARCHAR2(2);
t_country country_tab_type;
BEGIN
--Array füllen, Index ist hier eindeutig durch Länder ISO
t_country('AT') := 'Austria';
t_country('FR') := 'France';
t_country('DE') := 'Germany';
-- Welches Land verbirgt sich hinter dem ISO code "DE"
DBMS_OUTPUT.PUT_LINE('ISO code "DE" = ' || t_country('DE'));
END;
/