Thread: inserting into parent from child
01-03-10, 10:04 #1Registered User
- Join Date
- Jan 2010
Unanswered: inserting into parent from child
I have two object types tt and under_tt, under_tt was created under tt, both having corresponding object tables tt_tab and uner_tt_tab.
i already hav some objects in under_tt_tab, i want to these object into tt_tab.
this is what i tried with oracle 10g, but doesnt work:
Create or replace procedure test as
Cursor cur_sample is
Select * from under_tt_tab ;
fetch cur_sample into v;
exit when cur_sample%notfound;
insert into tt_tab values(under_tt(v.bno, v.bname, v.mi, v.blo));
description of tables:
tt= bno, bname
under_tt = bno,bname,mi,blo
please show me how to insert into tt using substitutable feature of oracle 10g
01-03-10, 11:27 #2Registered User
Provided Answers: 1
- Join Date
- Aug 2003
- Where the Surf Meets the Turf @Del Mar, CA
> insert into tt_tab values(under_tt(v.bno, v.bname, v.mi, v.blo));
Since TT_TAB contains only 2 fields, what should be done with the "extra" fields in UNDER_TT_TAB in statement above?
Why are you messing with object tables to begin with; especially when it appears you do not know how to properly manipulate them?
Why not use regular heap tables?You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.