Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PL/SQL tables

Status
Not open for further replies.

Sjoker

Programmer
Aug 4, 2000
30
NL
Hi,

I want to do the following (if possible) using PL/SQL tables:
I've got two tables:
table_1(parent_id,child_id)
table_2(id_old,id_new)

In table_1 I've got
parent_id child_id
1 2

In table_2 I've got
id_old id_new
1 3
2 4

Now I need to insert into table_1 the new parent_child relation so table_1 looks like:
parent_id child_id
1 2
3 4

I now do this using
insert into table_1 (
parent_id ,
child_id)
( select t1.id_blok_nieuw, t2.id_blok_nieuw
from table_2 t1, table_2 t2, table_1 t3
where t1.id_old = t3.parent_id
and t2.id_old = t3.child_id);

This works fine, but I don't want table_2 as a physical table, so I thought about using PL/SQL tables.

I can't make this work, can anyone help me?????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top