SQL>
SQL> create table employee (
2 id number not null,
3 employee_type_id number not null,
4 external_id varchar2(30) not null,
5 first_name varchar2(30) not null,
6 middle_name varchar2(30),
7 last_name varchar2(30) not null,
8 name varchar2(100) not null,
9 birth_date date not null,
10 gender_id number not null );
Table created.
SQL>
SQL> declare
2 TYPE name_record is record (
3 first_name employee.first_name%TYPE,
4 middle_name employee.middle_name%TYPE,
5 last_name employee.last_name%TYPE );
6 TYPE name_table is table of name_record index by binary_integer;
7 t_name name_table;
8 begin
9 t_name(1).first_name := 'JOHN';
10 t_name(1).last_name := 'DOE';
11 t_name(2).first_name := 'JANE';
12 t_name(2).last_name := 'DOE';
13
14 dbms_output.put_line(t_name(1).last_name||', '||t_name(1).first_name);
15 dbms_output.put_line(t_name(2).last_name||', '||t_name(2).first_name);
16 end;
17 /
DOE, JOHN
DOE, JANE
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> drop table employee;
Table dropped.
SQL>