User Tools

Site Tools


kurs:p_index_by_record
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
kurs/p_index_by_record.txt · Last modified: 2014/09/10 21:22 (external edit)