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!

help in joining nested table with regular table

michaelrozar17Apr 30 2012 — edited Apr 30 2012
Im creating a nested table codelist as object prtcnpt_info. In a anonymous block im declaring t_code as nested table type codelist.
Now when i try to join the nested table with the regular oracle DB table and i get error: PL/SQL: ORA-00904: "COLUMN_VALUE": invalid identifier.
Please help me on this and provide tutorial link pertaining to this concepts..Below is the code i wrote

--Code Start;
create or replace type prtcnpt_info as object ( id number
,name varchar2(200)
,code varchar2(30));


create type codelist is table of prtcnpt_info;


declare
t_code codelist;
begin

select prtcnpt_info(b.pid ,b.name ,pt.code) bulk collect into t_code
from part pt
,mc_code b
where pt.cd in ('AAA','BBB')
and pt.ptype_id=b.pt_type_id;


INSERT INTO table ( ID
,RUN_ID
,DATA
,P_ID
)
SELECT id
,run_id
,data
,prtct.id ----> 1
FROM table_2 t2
,(select column_value from table(t_code)) prtct
WHERE prtct.id=t2.P_ID; ------> 2

end;

--Code End;
also from the anonymous block
1 => is this correct way to get value of id (b.pid) from the nested tablet_code aliased as prtct ?
2 => is this correct way to join the nested table with regular table? i want to join the column id's in both the tables.

Edited by: 914912 on Apr 30, 2012 2:11 AM
This post has been answered by Karthick2003 on Apr 30 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2012
Added on Apr 30 2012
5 comments
2,520 views