PL/SQL (MOSC)

MOSC Banner

How to iterate through a set of nested tables

edited Aug 30, 2012 9:03PM in PL/SQL (MOSC) 4 commentsAnswered
Hi -

Thank you for your help with this.

Is there any way to step through a set of nested tabels?

Say you have this code:

declare

     type t1 is table of varchar2(1);

     type t2 is table of varchar2(1);

     type t3 is table of varchar2(1);

     l1 t1 := t1('a','b','c');

     l2 t2 := t2('d','e','f');

     l3 t3 := t3('g','h','i');

     type tMasterCollection is table of types; -- <== This is the part I don't know how to do.

     lMasterCollection tMasterCollection := tMasterCollection(l1,l2,l3);

     begin

           for iTypes in lMasterCollection.first..lMasterCollection.last loop <<loop1>>

                dbms_output.put_line('We will now iterate through values in type ' || lMasterCollection(iTypes) || '.';

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center