This shows you the differences between two versions of the page.
kurs:p_index_by_record [2014/09/10 21:22] |
kurs:p_index_by_record [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | PROCEDURE P_INDEX_BY_RECORD | ||
+ | IS | ||
+ | TYPE person_type IS RECORD ( | ||
+ | vorname VARCHAR (20), | ||
+ | nachname VARCHAR (20) | ||
+ | ); | ||
+ | TYPE person_type_table IS TABLE OF person_type | ||
+ | INDEX BY BINARY_INTEGER; | ||
+ | |||
+ | person person_type; | ||
+ | person_table person_type_table; | ||
+ | BEGIN | ||
+ | person.vorname := 'Mark'; | ||
+ | person.nachname := 'Hofstetter'; | ||
+ | person_table (1).vorname := 'Irene'; | ||
+ | person_table (1).nachname := 'Kaiser'; | ||
+ | person_table (13).vorname := 'Christian'; | ||
+ | person_table (13).nachname := 'Gartner'; | ||
+ | DBMS_OUTPUT.put_line (person.vorname || ' ' || person.nachname); | ||
+ | |||
+ | if person_table.exists(12) and | ||
+ | person_table.exists(1) then | ||
+ | DBMS_OUTPUT.put_line ( person_table (1).vorname | ||
+ | || ' ' | ||
+ | || person_table (12).nachname | ||
+ | ); | ||
+ | end if; | ||
+ | DBMS_OUTPUT.put_line ( person_table.count ); | ||
+ | END; -- Procedure | ||
+ | </code> |