PL/SQL   «Prev 

Querying Oracle Nested Table[Process Description]

DECLARE
t_sale_id     sale_header.sale_id%type;
Three variables for the three columns within the SALE_HEADER table and define a cursor that selects these three columns from the SALE_HEADER table.

BEGIN
  OPEN obj_table;
	  LOOP
 
Within the procedural section, open the cursor and loop through all the records.

Next, fetch the data into the variables defined within the declaration section and display the data pertaining to the attributes of the object table by using DBMS _OUTPUT.

To display the data of the nested table, initiate another FOR loop to go through each record of the nested table, which is ascertained by using a count of the variable that contains the value of the nested table, here it is t_detail_nest.