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?????
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?????