VARRAYs, nested tables, index-by tables : Table of Varchar2 « PL SQL « Oracle PL / SQL






VARRAYs, nested tables, index-by tables

    

-- VARRAYs, nested tables, index-by tables

DECLARE
   TYPE name_nested_typ IS TABLE OF VARCHAR2(20);

   first_name_table name_nested_typ;
   TYPE             name_index_by_typ IS TABLE OF VARCHAR2(20) INDEX BY BINARY_INTEGER;
   last_name_table  name_index_by_typ;
BEGIN
   
   first_name_table := name_nested_typ('A', 'B','C'); 
   first_name_table.EXTEND;
   first_name_table(4) := 'Ringo';
   last_name_table(3) := 'Smith';
   DBMS_OUTPUT.PUT_LINE(first_name_table(4));

END;



           
         
    
    
    
  








Related examples in the same category

1.Varchar table indexed by BINARY_INTEGER
2.Define 'table of varchar2' as data type and insert data
3.Table of varchar2 element count
4.Delete element in table of varchar2
5.Table of varchar2 delete all
6.Insert elements into table of varchar2
7.Clear the table of varchar2
8.A NULL table, and a table with a NULL element.
9.Assign value to table records
10.Reference count property of table record
11.Call delete method with number on table record
12.Call delete method on table record
13.Assign value to table record after delete method call
14.Assing an empty table record to non-empty table record
15.first last next
16.dbms_sql.varchar2_table type
17.Assign to three elements of the table. Note that the key values are not sequential
18.behavior of NULL nested tables.
19.Declare a nested table with null values.
20.index by binary integer or by varchar2
21.Assign value to varchar2 collection by index
22.Assign values to subscripted members of the nested table.
23.Assign the first character index to a variable.
24.Assign the character index to a variable.
25.Allocate space as you increment the index.
26.You cannot traverse an associative array until elements are initialized.
27.Dynamic initialization and assignment in the execution section.