Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Populating a OBJECT (type) within a TABLE (type)

lvs85003Apr 14 2017 — edited Apr 14 2017

I have just started to use "COLLECTIONS"  and therefore still a little confused and need help.

I have the following PL/SQL code snippet:

TYPE DQRY IS OBJECT( TNAME VARCHAR2(20), XPRCL  VARCHAR2(250));

TYPE DTBL IS TABLE OF DQRY INDEX BY VARCHAR2(4);

xtbl   DTBL:

How do I populate the OBJECT 'DQRY' in the TABLE "DTBL"?

My end goal is to have a record that looks like this:

xtbl('CP") =  dqry(' CASRP ', ' CP_BOOK_NUM || CP_MAP_NUM || CP_ITEM_NUM = ')

In other words, i want to have a 'TNAME' and a 'XPRCL' for a specific two character code.

And just to cover all my basses, how do i retrieve 'TNAME' and a 'XPRCL' for a specific code (e.g. "CP")?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2017
Added on Apr 14 2017
3 comments
817 views