Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010

    Question Unanswered: inserting into parent from child

    hi everyone,
    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
    v under_tt_tab%rowtype;
    Cursor cur_sample is
    Select * from under_tt_tab ;
    open cur_sample;
    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));
    end loop;

    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

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    > 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts