Recall that our last example tracked engine repairs and used a varray to track the condition of the spark plugs that were pulled from the engine. The structure we had created looked like the following: Create or replace type spark_plug_va as varray(12) of varchar2(12) / Create table engine_condition( Check_date date, Cust_id number, Spark_plugs spark_plug_va) / So now that we have inserted data into our table, what happens when we select it back out using SQL? Let?s give it a try: SQL> select * from engine_condition; CHECK_DAT CUST_ID SPARK_PLUGS --------- ------- --------------------------------------------- 06-JUN-99 3 SPARK_PLUG_VA('GOOD', 'BAD', 'FAIR', 'FAIR') 07-JUN-99 4 SPARK_PLUG_VA('GOOD', 'EXCELLENT', 'GOOD', 'BAD', 'BAD', 'FAIR') It appears that the constructor function we used last week to make the insert is also used to retrieve the values for our spark plugs. But this wouldn't look very pretty in that nice report that you need to build for your customer. You need to sling a little PL/SQL to get to the data: declare cursor engine_c is select * from engine_condition; begin for engine_rec in engine_c LOOP dbms_output.put_line('Check Date: '||engine_rec.check_date|| ' Customer ID: '||engine_rec.cust_id); for i in 1..engine_rec.spark_plugs.count LOOP dbms_output.put_line('. Spark Plug #'||i||' - '||engine_rec.spark_plugs(i)); end loop; end loop; end; / We have created a cursor loop for our engine_condition table. Within this loop we have another loop that will loop through each value in our varray, only for the plugs that have values (found with spark_plugs.count). So after we execute our PL/SQL, we get the following results: Check Date: 06-JUN-99 Customer ID: 3 . Spark Plug #1 - GOOD . Spark Plug #2 - BAD . Spark Plug #3 - FAIR . Spark Plug #4 - FAIR Check Date: 07-JUN-99 Customer ID: 4 . Spark Plug #1 - GOOD . Spark Plug #2 - EXCELLENT . Spark Plug #3 - GOOD . Spark Plug #4 - BAD . Spark Plug #5 - BAD . Spark Plug #6 - FAIR The values in our varray are now directly accessible to us.