Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Using PL/SQL, suppose we've declared a nested table type and its instance as follows:

type nested_tab is table of pls_integer;
tab nested_tab;.

We are then able to initialize our nested table as follows:

tab := nested_tab(1, 2, 3);.

Is there something similar we can do to initialize an associative array?

In other words, for the following associate array:

type associative_tab is table of varchar2(100) index by pls_integer;
a_tab associative_tab;

is there a shorter way than this:

a_tab(1) := 'hello';
a_tab(2) := 'world';
a_tab(100) := '100th string';

for intialization?

share|improve this question
I don't think there's a shorter way to do it; if there is, it would probably be here: docs.oracle.com/cd/B19306_01/appdev.102/b14261/… –  FrustratedWithFormsDesigner Jul 17 '12 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.