1 Reply Latest reply: Apr 8, 2011 11:08 AM by gaverill RSS

    how to insert reference of object in nested table

    Arash
      hi , i have a problem with nested table :

      CREATE OR REPLACE TYPE ITEM AS OBJECT
      (
      ITEM_ID NUMBER,
      ITEM_DES VARCHAR2(4000),
      PRODUCT_NO VARCHAR2(15),
      PRODUCT_DES VARCHAR2(4000)
      );
      CREATE TABLE ITEMS OF ITEM
      (
      CONSTRAINT ITEM_PK PRIMARY KEY (ITEM_ID)
      );
      CREATE OR REPLACE TYPE BOM AS OBJECT
      (
      BOM_ID NUMBER,
      ITEM_ID NUMBER,
      BOM_PARENT_ID number
      );

      create or replace type boms as table of ref bom;
      create table bom_table
      (
      bom_ids bom,bom_member boms
      ) nested table bom_member store as bom_childs;
      insert into bom_table (bom(1,1,null),null);
      insert into bom_table (bom(2,1,1),boms(select ref(t) from bom_table t where t.bom_id=1))
      show error.

      how i can insert in nested table reference of object
      thanks