Define 'table of varchar2' as data type and insert data
SQL>
SQL>
SQL> declare
2 type myTextTableType is table of varchar2(200) index by binary_integer;
3
4 l_text_table myTextTableType;
5 l_empty_table myTextTableType;
6 begin
7 l_text_table(10) := 'A value';
8 l_text_table(20) := 'Another value';
9 l_text_table(30) := 'Yet another value';
10
11 l_text_table(15) := 'some text';
12 l_text_table(25) := 'some more text';
13 dbms_output.put ('After some assignments, we end up with ');
14 dbms_output.put_line(l_text_table.count || ' varchar2s ');
15 dbms_output.put_line('-');
16
17 end;
18 /
After some assignments, we end up with 5 varchar2s
-
PL/SQL procedure successfully completed.
SQL>
Related examples in the same category