Queue Table on Nested Objects

Queue Table with Nested Objects
I need to create a queue table based on nested object
These are my declarations
TYPE TESTATATYPE AS OBJECT (
CODICE VARCHAR2(5),
DESCRIZIONE VARCHAR2(30)
TYPE DETTAGLIOTYPE AS OBJECT (
CODICE VARCHAR2(5),
DESCRIZIONE VARCHAR2(30),
VALORE NUMBER
TYPE DETTAGLITYPE IS TABLE OF DETTAGLIOTYPE
TYPE MESSAGGIOTYPE AS OBJECT (
TESTATA TESTATATYPE,
DETTAGLI DETTAGLITYPE
Now i'm trying to create queue table
DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table => 'MsgQTab',
queue_payload_type => 'MessaggioType',
storage_clause => 'NESTED TABLE
dettagli STORE AS dettagli_tab_Q',
sort_list => 'priority,enq_time'
but I get
ORA-00904: invalid column name
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2012
ORA-06512: at "SYS.DBMS_AQADM", line 55
ORA-06512: at line 3
maybe the problem is storage clause, can you help me ?
null

Andrea,
You cannot currently use a nested table even as an embedded object within a message payload.
However, you can create an object type that contains one or more VARRAYs, and create a queue table that is founded on this object type. I guess this might be the problem you are facing.

Similar Messages

  • Queue Table = Queue Mapping

    As i understand it, having a queue table of same object type as the queue gives benefit of message peeking, better auditing & debugging capabilities. Does this mean if i modify the object type to add/drop a column, i need to drop/recreate the queue table ?
    Other approach could be to use RAW or XMLTYPE as payload. Here many queues could map to one queue table.
    What are key design criterion or pros/cons in choosing one of these approaches ? Any guidelines or best practices in this regard ?

    As i understand it, having a queue table of same object type as the queue gives benefit of message peeking, better auditing & debugging capabilities. Does this mean if i modify the object type to add/drop a column, i need to drop/recreate the queue table ?Yes, this would mean you have to drop/recreate the queue
    Other approach could be to use RAW or XMLTYPE as payload. Here many queues could map to one queue table. RAW queues - you cannot specify rules/conditions on the message content
    XMLTYpe queues - this will solve the problems you listed above. However, in 9.0 - you have to create an ADT with an embedded XMLType to use these.
    In 9.2 - you can create the queue table with SYS.XMLTYPE payload

  • Replace message payload object without remove queue table

    hi,
    i want to replace message payload object without remove queue table but i have got the "ORA-02303: cannot drop or replace a type with type or table dependents" error.
    is there any way to replace message payload object without remove queue table?
    Click to link below to find a demo which is explain the problem clearly
    Replace message payload object without remove queue table
    Regards.

    Hi
    I answered this in Re: Replace message payload object without remove queue table forum.
    Cheers, APC

  • Edit message payload object without remove queue table

    Hi, need ur help again,
    Known that if we want to modify a message payload attribute (add,edit or delete), we will fail to do so if the message payload is used by existing AQ's queue table.
    How to change the message payload object without remove the queue table?
    Thanks!

    Hi
    I answered this in Re: Replace message payload object without remove queue table forum.
    Cheers, APC

  • Error when creating table with nested table of object

    Dear all,
    I tried to create a table that contains nested table of an object but got an error:
    create or replace type some_obj is object (
      a number, b blob
      4  /
    Type created.
    create or replace type some_type is table of some_obj;
      2  /
    Type created.
    SQL>
    create table test (obj_id number, temp some_type) nested table temp store as nes_tab;
    Table created.
    SQL> create table test (obj_id number, temp some_type) nested table temp store as nes_tab
    ERROR at line 1:
    ORA-00955: name is already used by an existing objectWhat is causing the error? How can I troubleshoot this?
    best regards,
    Val

    Valerie Debonair wrote:
    never mind, I put "/" at the end of the create statement that makes executing create table twice....Yep. If I'm writing a script, I tend to just stick with "/" for all my statements, including the SQL as well as the DDL, otherwise it can be confusing whether a ";" is needed or not or whether it will try and execute it twice like you found.
    "/" works for all.

  • Inserting into a doubly nested table through an object view

    Can anyone give me an example of an INSTEAD OF trigger that will mediate an INSERT into a doubly nested table of an Object View? Is there syntax that will allow it?

    Here's some code to demonstrate. Note that relational tables, not an object table, are used to store object instances:
    create or replace type TInnerNestedTable
    is table of varchar2(20)
    create or replace type TOuterNestedTable
    is table of TInnerNestedTable
    create or replace type TMyObject
    is object
         id     varchar2(20)
    ,     tab     TOuterNestedTable
    create
    table     T_MY_OBJECT
         id          varchar2(20)     not null
    ,     primary key (id)
    create
    table     T_MY_OBJECT_TAB_OUTER
         id          varchar2(20)     not null
    ,     outerIndex     integer          not null
    ,     primary key (id, outerIndex)
    ,     foreign key (id) references T_MY_OBJECT on delete cascade
    create
    table     T_MY_OBJECT_TAB_INNER
         id          varchar2(20)     not null
    ,     outerIndex     integer          not null
    ,     innerIndex     integer          not null
    ,     innerValue     varchar2(20)
    ,     primary key (id, outerIndex, innerIndex)
    ,     foreign key (id, outerIndex) references T_MY_OBJECT_TAB_OUTER on delete cascade
    create or replace view V_MY_OBJECT
    of TMyObject
    with object identifier (id)
    as
    select     t.id
    ,     cast(multiset(
              select     cast(multiset(
                        select     i.innerValue
                        from     T_MY_OBJECT_TAB_INNER i
                        where     i.id = o.id
                        and     i.outerIndex = o.outerIndex
                   ) as TInnerNestedTable)
              from     T_MY_OBJECT_TAB_OUTER o
              where     o.id = t.id
         ) as TOuterNestedTable)
    from     T_MY_OBJECT t
    create or replace trigger TR_II_V_MY_OBJECT
    instead of insert on V_MY_OBJECT
    for each row
    begin
         insert
         into     T_MY_OBJECT
              id
         values     (
              :new.id
         insert
         into     T_MY_OBJECT_TAB_OUTER
              id
         ,     outerIndex
         select     :new.id
         ,     rownum
         from     table(:new.tab) o;
         insert
         into     T_MY_OBJECT_TAB_INNER
              id
         ,     outerIndex
         ,     innerIndex
         ,     innerValue
         select     :new.id
         ,     o.outerIndex
         ,     rownum
         ,     value(i)
         from     (
              select     :new.id
              ,     rownum outerIndex
              ,     value(o) innerTab
              from     table(:new.tab) o
              ) o
         ,     table(o.innerTab) i;
    end;
    insert
    into     V_MY_OBJECT
    values     (
         new TMyObject(
              'A'
         ,     TOuterNestedTable(
                   TInnerNestedTable('A','B','C')
              ,     TInnerNestedTable('AA')
              ,     TInnerNestedTable('AB')
    insert
    into     V_MY_OBJECT
    values     (
         new TMyObject(
              'B'
         ,     TOuterNestedTable(
                   TInnerNestedTable('X','Y','Z')
              ,     TInnerNestedTable('Hello', 'World!')
    /Selecting from the view shows the results:
    select     value(o)
    from     V_MY_OBJECT o
    VALUE(O)(ID, TAB)
    TMYOBJECT('A', TOUTERNESTEDTABLE(TINNERNESTEDTABLE('A', 'B', 'C'), TINNERNESTEDTABLE('AA'), TINNERNESTEDTABLE('AB')))
    TMYOBJECT('B', TOUTERNESTEDTABLE(TINNERNESTEDTABLE('X', 'Y', 'Z'), TINNERNESTEDTABLE('Hello', 'World!')))
    2 rows selected.Hope that helps...
    Gerard

  • Require help on Array of Nested tables and Oracle Object type

    Hi All,
    I have a scenario where I have some millions of records received from a flat file and the record is stored in Table as below:
    Tablename: FILE_RECORD
    Rows:
    FILE_REG_ID = 1
    RECORD_NBR = 1     
    PROCESSED_IND = U
    RECORD= 00120130326006A
    FILE_REG_ID = 1
    RECORD_NBR = 2     
    PROCESSED_IND = U
    RECORD= 00120130326003
    1) I have to read these records at once and
    a) Split the RECORD column to get various other data Eg: Fld1=001, Fld2=20130326, Fld3 = 003
    b) send as an Array to Java.
    2) Java will format this into XML and sent to other application.
    3) The other application returns a response as Successful or Failure to Java in XML
    4) Java will send RECORD_NBR and the corresponding response as Success or Failure back to PLSQL
    5) PLSQL should match the RECORD_NBR and update the PROCESSED_IND = P.
    I 'm able to achieve this using SQL Table type by creating a TYPE for Each of the fields (Flds) however the problem is Java cannot Access the parameters as the TYPE are of COLUMN Types
    Eg: For RECORD_NBR
    SUBTYPE t_record_nbr IS FILE_RECORD.T010_RECORD_NBR%TYPE;
    Can you please let me know how I can achieve this to support Java, I know one way that is by creating an OBJECT TYPE and a TABLE of the OBJECT TYPE.
    Eg: T_FILE_RECORD_REC IS OBJECT
    FILE_REG_ID number(8), RECORD_NBR number (10), PROCESSED_IND varchar2(1), RECORD varchar(20)
    Create type T_FILE_RECORD_TAB IS TABLE OF T_FILE_RECORD_REC
    However I'm facing a problem to populate an Array of records, I know I'm missing something important. Hence please help.
    It would be helpful to provide some guidelines and suggestions or Pseudo or a Code to achieve this. Rest all I can take up further.
    Thanks in advance,

    I know once way that is creating a OBJECT TYPE and a TABLE of OBJECT TYPE, howeve I feel I'm missing something to achieve this.You're right, you need SQL object types created at the database level. Java doesn't know about locally defined PL/SQL types
    However you can do without all this by creating the XML directly in PL/SQL (steps 1+2) and passing the document to Java as XMLType or CLOB.
    Are you processing the records one at a time?

  • ORA-22913 while creating a QUEUE TABLE of a "Typed type"

    Hi guys:
    I'm trying to recreate an [AskTom's post|http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:8760267539329], but with a single difference. My Oracle Type contains a field that is another Oracle Type and when I try to create a QUEUE_TABLE, I got the ORA-22913.
    Here are my steps:
    create or replace TYPE PODTL_TYPE AS OBJECT
    item varchar2(25),
    ref_item varchar2(25),
    physical_location_type varchar2(1),
    physical_location number(10),
    physical_qty_ordered number(12,4),
    unit_cost number(20,4),
    origin_country_id varchar2(3),
    supp_pack_size number(12,4),
    earliest_ship_date date,
    latest_ship_date date,
    pickup_loc varchar2(250),
    pickup_no varchar2(25),
    packing_method varchar2(6),
    round_lvl varchar2(6),
    door_ind varchar2(1),
    priority_level number(1),
    new_item varchar2(1),
    quarantine varchar2(1),
    rcvd_unit_qty number(12,4),
    tsf_po_link_id number(10),
    cost_source varchar2(4),
    est_in_stock_date date
    create or replace TYPE PODtl_coll as table of PODTL_TYPE;
    create or replace TYPE PODesc AS OBJECT
    doc_type varchar2(1),
    order_no varchar2(10),
    order_type varchar2(9),
    order_type_desc varchar2(250),
    dept number(4),
    dept_name varchar2(120),
    buyer number(4),
    buyer_name varchar2(120),
    supplier varchar2(10),
    promotion number(10),
    prom_desc varchar2(160),
    qc_ind varchar2(1),
    not_before_date date,
    not_after_date date,
    otb_eow_date date,
    earliest_ship_date date,
    latest_ship_date date,
    close_date date,
    terms varchar2(15),
    terms_code varchar2(50),
    freight_terms varchar2(30),
    cust_order varchar2(1),
    payment_method varchar2(6),
    payment_method_desc varchar2(40),
    backhaul_type varchar2(6),
    backhaul_type_desc varchar2(40),
    backhaul_allowance number(20,4),
    ship_method varchar2(6),
    ship_method_desc varchar2(40),
    purchase_type varchar2(6),
    purchase_type_desc varchar2(40),
    status varchar2(1),
    ship_pay_method varchar2(2),
    ship_pay_method_desc varchar2(40),
    fob_trans_res varchar2(2),
    fob_trans_res_code_desc varchar2(40),
    fob_trans_res_desc varchar2(250),
    fob_title_pass varchar2(2),
    fob_title_pass_code_desc varchar2(40),
    fob_title_pass_desc varchar2(250),
    vendor_order_no varchar2(15),
    exchange_rate number(20,10),
    factory varchar2(10),
    factory_desc varchar2(240),
    agent varchar2(10),
    agent_desc varchar2(240),
    discharge_port varchar2(5),
    discharge_port_desc varchar2(150),
    lading_port varchar2(5),
    lading_port_desc varchar2(150),
    bill_to_id varchar2(5),
    freight_contract_no varchar2(10),
    po_type varchar2(4),
    po_type_desc varchar2(120),
    pre_mark_ind varchar2(1),
    currency_code varchar2(3),
    contract_no number(6),
    pickup_loc varchar2(250),
    pickup_no varchar2(25),
    pickup_date date,
    app_datetime date,
    comment_desc varchar2(2000),
    PODtl PODtl_coll
    These are my 3 Oracle types. When I try to create the QUEUE TABLE:
    DBMS_AQADM.CREATE_QUEUE_TABLE(
    Queue_table => 'PODESC_QUEUE_TABLE',
    Queue_payload_type => 'PODesc',
    Multiple_consumers => TRUE);
    END;
    I got the following error:
    22913. 00000 - "must specify table name for nested table column or attribute"
    *Cause:    The storage clause is not specified for a nested table column
    or attribute.
    *Action:   Specify the nested table storage clause for the nested table
    column or attribute.
    How can I solve this?

    Here is the syntax used by Oracle in one of their internal tables.
    orabase> select dbms_metadata.get_ddl('TABLE', 'ORDERS_QUEUETABLE', 'IX') from dual;
    DBMS_METADATA.GET_DDL('TABLE','ORDERS_QUEUETABLE','IX')
      CREATE TABLE "IX"."ORDERS_QUEUETABLE"
       (    "Q_NAME" VARCHAR2(30),
            "MSGID" RAW(16),
            "CORRID" VARCHAR2(128),
            "PRIORITY" NUMBER,
            "STATE" NUMBER,
            "DELAY" TIMESTAMP (6),
            "EXPIRATION" NUMBER,
            "TIME_MANAGER_INFO" TIMESTAMP (6),
            "LOCAL_ORDER_NO" NUMBER,
            "CHAIN_NO" NUMBER,
            "CSCN" NUMBER,
            "DSCN" NUMBER,
            "ENQ_TIME" TIMESTAMP (6),
            "ENQ_UID" VARCHAR2(30),
            "ENQ_TID" VARCHAR2(30),
            "DEQ_TIME" TIMESTAMP (6),
            "DEQ_UID" VARCHAR2(30),
            "DEQ_TID" VARCHAR2(30),
            "RETRY_COUNT" NUMBER,
            "EXCEPTION_QSCHEMA" VARCHAR2(30),
            "EXCEPTION_QUEUE" VARCHAR2(30),
            "STEP_NO" NUMBER,
            "RECIPIENT_KEY" NUMBER,
            "DEQUEUE_MSGID" RAW(16),
            "SENDER_NAME" VARCHAR2(30),
            "SENDER_ADDRESS" VARCHAR2(1024),
            "SENDER_PROTOCOL" NUMBER,
            "USER_DATA" "IX"."ORDER_EVENT_TYP" ,   <---------------------- seems analogous to what you are trying to do
            "USER_PROP" "SYS"."ANYDATA" ,
             PRIMARY KEY ("MSGID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "EXAMPLE"  ENABLE
       ) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "EXAMPLE"
    OPAQUE TYPE "USER_PROP" STORE AS BASICFILE LOB (
      ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
      CACHE
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))Spend some time looking in directories under $ORACLE_HOME and you may well find the DDL that built it.

  • RMS subscriber queue table

    Hai,
    Please any one explain me.In RMS publish a message through RIB means we check the queues of message in particular message family queue table
    Example:
    if "Store" Message family publish a message means we check the queue in  "STORE_MFQUEUE"
    likewise
    In subscriber side ,if  "Inventory adjustment" message family subscribe a message means where we have to check the queue.
    Please share the views.

    Andrea,
    You cannot currently use a nested table even as an embedded object within a message payload.
    However, you can create an object type that contains one or more VARRAYs, and create a queue table that is founded on this object type. I guess this might be the problem you are facing.

  • Null value in Nested table of nested table for xml guru Steve Muench

    The procedure I am using takes xml document with nested levels and insert into single table using DBMS_XMLSave.insertXML.
    I am able to insert into table without any error message but when I am selecting row from table, it is showing null values in all the column of nested table's inner nested table.
    When I am removing nested table's nested table by replacing with object type, it is showing data of object type for the first occurance and ignoring the rest nested occurance.
    Help is greatly appreciated.
    Below is the sql I used to create objects and table:-
    Create or Replace Type addressType as Object
    Line_one     varchar2(40),
    Line_two     varchar2(40),
    City          Varchar2(30),
    State          Varchar2(2),
    zip          Varchar2(10)
    Create or Replace Type ce_reqType as Object
    Status               varchar2(25),
    Status_date          Date,
    type_code          Varchar2(25),
    review_begin_date     Date,
    assigned_review_date     date
    Create or Replace type ce_reqListType
    as table of ce_reqType;
    Create or Replace Type LicenseType as Object
    type_code          Varchar2(10),
    license_number          Varchar2(16),
    ce_requirements      ce_reqListType
    Create or Replace type LicenseListType
    as table of LicenseType;
    Create table IndividualType
    individual_id          Number(9),
    social_security_number Varchar2(9),
    Last_name          varchar2(40),
    First_name          Varchar2(40),
    Middle_name          Varchar2(40),
    Birth_date          Date,
    address          addressType,
    Licenses          LicenseListType
    nested table licenses store as licensestab
    (nested table ce_requirements store as lic_ce_reqtab);

    Maddy wrote:
    dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)Because instead of adding an element to bookset collectionto are assigning (ergo replacing) it a collection containing last fetched book. Use:
    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        for rec in (select * from book) loop --> Now Looping two times.
          dbms_output.put_line(' name > '||rec.name);
          bookset.extend;
          bookset(bookset.count) := book_obj(rec.name, rec.author, rec.abstract);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    PL/SQL procedure successfully completed.
    SQL> Or better use bulk collect:
    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        select  book_obj(name,author,abstract)
          bulk collect
          into  bookset
          from  book;
        for i in 1..bookset.count loop --> Now Looping two times.
          dbms_output.put_line(' name > '||bookset(i).name);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Unable to drop queue table

    Hi,
    I have the streams admin user as "stradmin" and i have a queue table called "STREAMS_CAPTURE_QT"
    I am not able to drop the streams user because i am not able to drop the queue table.
    I tried the following.....
    begin
    DBMS_AQADM.DROP_QUEUE_TABLE(
    queue_table => 'STREAMS_CAPTURE_QT',
    force => TRUE);
    end;
    but i get below error....
    begin
    ERROR at line 1:
    ORA-04031: unable to allocate 112 bytes of shared memory ("streams
    pool","unknown object","streams pool","qulptr_kwqbscc")
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 4102
    ORA-06512: at "SYS.DBMS_AQADM", line 197
    ORA-06512: at line 2
    I checked my init.ora parameter file and i do have...
    *.aq_tm_processes=0
    *.shared_pool_size=500M
    *.streams_pool_size=16777216
    *.event='10298 trace name context forever, level 32'
    Can someone help me to drop the queue table as well as the streams admin user.
    Thanks in advance.

    Have you tried increasing the SGA size?

  • Problems in creating Queue tables

    Hi I'm trying to create a Queue table. For that I'm creating a new Object, and then a table type of the same Object and then a Queue table of the payload type of the created table type, for which I'm getting an error. I'm using the following list of Queries:
    create or replace type CRM_TO_UMS_USR_DATA_TAB as object
    PROVISION_ID varchar2(25)
    PROVISION_DATE date
    ERROR_CODE varchar2(20)
    ERROR_MSG varchar2(50)
    STATUS char
    COMMENTS varchar2(50)
    Result => no Error
    create or replace type CRM_TO_UMS_USR_DATA_TYP as TABLE of CRM_TO_UMS_USR_DATA_TAB
    Result => no Error
    begin
    dbms_aqadm.create_queue_table(queue_table => 'CRM_TO_UMS_DATA_QUE_TAB',queue_payload_type => 'CRM_TO_UMS_USR_DATA_TAB');
    end;
    Result =>
    Error report:
    ORA-00902: invalid datatype
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2830
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 2
    00902. 00000 - "invalid datatype"
    I've given the following Grants for my schema user, for the purpose.
    Grant aq_administrator_role to siebel;
    GRANT EXECUTE ON dbms_aq TO siebel;
    GRANT RESOURCE TO siebel;
    GRANT CONNECT TO siebel;
    GRANT EXECUTE ANY PROCEDURE TO siebel;
    GRANT aq_administrator_role TO siebel;
    GRANT aq_user_role TO siebel;
    GRANT EXECUTE ON dbms_aqadm TO siebel;
    GRANT EXECUTE ON dbms_aqin TO siebel;
    Actually I've successfully created Queues with the above set of Queries in my other Development and UAT environments successfully, but when I'm trying to implement it with Prod I'm getting the Error. Anybody please help.
    Thanks & Regards,
    Srivathan, T.

    The type CRM_TO_UMS_USR_DATA_TAB is invalid because the syntax you're using is incorrect:
    SQL> create or replace type CRM_TO_UMS_USR_DATA_TAB as object
      2  (
      3  PROVISION_ID varchar2(25)
      4  PROVISION_DATE date
      5  ERROR_CODE varchar2(20)
      6  ERROR_MSG varchar2(50)
      7  STATUS char
      8  COMMENTS varchar2(50)
      9  );
    10  /
    Warning: Type created with compilation errors.
    SQL> begin
      2  dbms_aqadm.create_queue_table(queue_table => 'CRM_TO_UMS_DATA_QUE_TAB',queue_payload_type => 'CRM_TO_UMS_USR_DATA_TAB');
      3  end;
      4  /
    begin
    ERROR at line 1:
    ORA-00902: invalid datatype
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2822
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 2
    SQL> create or replace type CRM_TO_UMS_USR_DATA_TAB as object
      2  (
      3  PROVISION_ID varchar2(25),
      4  PROVISION_DATE date ,
      5  ERROR_CODE varchar2(20),
      6  ERROR_MSG varchar2(50),
      7  STATUS char(1),
      8  COMMENTS varchar2(50)
      9  );
    10  /
    Type created.
    SQL> begin
      2  dbms_aqadm.create_queue_table(queue_table => 'CRM_TO_UMS_DATA_QUE_TAB',queue_payload_type => 'CRM_TO_UMS_USR_DATA_TAB');
      3  end;
      4  /
    PL/SQL procedure successfully completed.Max
    http://oracleitalia.wordpress.com

  • Import tables with nested table : ORA-00600

    In Oracle 9.2
    Create object, type as table, and table with nested table (store as syms_ntab) are successfully.
    Also its export.
    In process of import on another server (also 9.2, 'fromuser=one touser=two') shows errors:
    . . importing table "SYMS_NTAB"
    IMP-00058: ORACLE error 600 encountered
    ORA-00600: internal error code, arguments: [kokeeafi1], [2], [2], [], [], [], [], []
    IMP-00075: Warning: The nested table may contain partial rows or duplicate rows
    But for all that table is created and error occur on phase inserting strings.
    What is this?
    In Oracle 8.0.5 i perform similar operation without error.

    From Oracle error messages and codes manual:
    ORA-00600 internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
    Cause: This is the generic internal error number for Oracle program exceptions. It indicates that a process has encountered a low-level, unexpected condition. Causes of this message include:
    * timeouts
    * file corruption
    * failed data checks in memory
    * hardware, memory, or I/O errors
    * incorrectly restored files
    The first argument is the internal message number. Other arguments are various numbers, names, and character strings. The numbers may change meanings between different versions of Oracle.
    Action: Report this error to Oracle Support Services after gathering the following information:
    * events that led up to the error
    * the operations that were attempted that led to the error
    * the conditions of the operating system and databases at the time of the error
    * any unusual circumstances that occurred before receiving the ORA-00600 message
    * contents of any trace files generated by the error
    * the relevant portions of the Alter files
    Note: The cause of this message may manifest itself as different errors at different times. Be aware of the history of errors that occurred before this internal error.

  • Problem in truncate/drop partitions in a table having nested table columns.

    Hi,
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table? IF I change column types from nested table to varray type, will it help?
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    Thanks in advance.

    >
    I have a table that has 2 columns of type nested table. Now in the purge process, when I try to truncate or drop a partition from this table, I get error that I can't do this (because table has nested tables). Can anybody help me telling how I will be able to truncate/drop partition from this table?
    >
    Unfortunately you can't do those operations when a table has a nested table column. No truncate, no drop, no exchange partition at the partition level.
    A nested table column is stored as a separate table and acts like a 'child' table with foreign keys to the 'parent' table. It is these 'foreign keys' that prevent the truncation (just like normal foreign keys prevent truncating partions and must be disabled first) but there is no mechanism to 'disable' them.
    Just one excellent example (there are many others) of why you should NOT use object columns at all.
    >
    IF I change column types from nested table to varray type, will it help?
    >
    Yes but I STRONGLY suggest you take this opportunity to change your data model to a standard relational one and put the 'child' (nested table) data into its own table with a foreign key to the parent. You can create a view on the two tables that can make data appear as if you have a nested table type if you want.
    Assuming that you are going to ignore the above advice just create a new VARRAY type and a table with that type as a column. Remember VARRAYs are defined with a maximum size. So the number of nested table records needs to be within the capacity of the VARRAY type for the data to fit.
    >
    Also, is there any short method of moving existing data from a nested table column to a varray column (having same fields as nested table)?
    >
    Sure - just CAST the nested table to the VARRAY type. Here is code for a VARRAY type and a new table that shows how to do it.
    -- new array type
    CREATE OR REPLACE TYPE ARRAY_T AS VARRAY(10) OF VARCHAR2(64)
    -- new table using new array type - NOTE there is no nested table storage clause - arrays stored inline
    CREATE TABLE partitioned_table_array
         ( ID_ INT,
          arra_col  ARRAY_T )
         PARTITION BY RANGE (ID_)
         ( PARTITION p1 VALUES LESS THAN (40)
         , PARTITION p2 VALUES LESS THAN(80)
         , PARTITION p3 VALUES LESS THAN(100)
    -- insert the data from the original table converting the nested table data to the varray type
    INSERT INTO PARTITIONED_TABLE_ARRAY
    SELECT ID_, CAST(NESTED_COL AS ARRAY_T) FROM PARTITIONED_TABLENaturally since there is no more nested table storage you can truncate or drop partitions in the above table
    alter table partitioned_table_array truncate partition p1
    alter table partitioned_table_array drop partition p1

  • TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)

    제품 : SQL*PLUS
    작성날짜 : 2004-05-20
    ==================================================
    TYPE OR TABLE DEPENDENCY OF OBJECT TYPE (ORA-2303)
    ==================================================
    PURPOSE
    Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
    하면 ORA-02303 error가 난다. 이 error의 원인을 알아보도록 한다.
    Explanation
    Object의 attribute나 method를 수정하기 위해서는 object type을 drop하고 재생성
    해야 한다. Type이나 table의 dependency가 있는 type을 drop하거나 replace하고자
    하면 ORA-02303 error가 난다. Object type은 type (nested table 또는 VARRAY)
    또는 object table로써 구체적으로 표현된다. 만약 data의 보존이 필요하다면
    temporary table에 manual하게 옮겨놓아야 한다.
    SQL Reference guide에 의하면 DROP TYPE FORCE 옵션은 recommend하지 않는다.
    왜냐하면 이 옵션을 쓰게 되면 복구가 불가능하고 dependency가 있던 table들은
    access하지 못하는 결과를 초래한다.
    Example
    아래의 query 1, 2, 3은 dependency을 확인하는 query문이다.
    1. Find nested tables
    select owner, parent_table_name, parent_table_column
    from dba_nested_tables
    where (table_type_owner, table_type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = '<typeOwner>'
    and elem_type_name = '<typeName>');
    2. Find VARRAYs
    select owner, parent_table_name, parent_table_column
    from dba_varrays
    where (type_owner, type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = '<typeOwner>'
    and elem_type_name = '<typeName');
    3. Find object tables
    select owner, table_name
    from dba_object_tables
    where table_type_owner = '<typeOwner>'
    and table_type = '<typeName>'
    and nested = 'NO';
    Example ) Logon as Scott
    /* Create an user defined object type */
    SQL> create type object_type as object (
    col1 number,
    col2 varchar2(20))
    Type created.
    /* Create nested table type */
    SQL> create type object_ntable as table of object_type
    Type created.
    /* Create varray type*/
    SQL> create type object_varray as varray(5) of object_type
    Type created.
    /* Create parent table with nested table and varray */
    SQL> create table master (
    col1 number primary key,
    col2_list object_ntable,
    col3_list object_varray)
    nested table col2_list store as master_col2
    Table created.
    /* Create object table */
    SQL> create table object_table of object_type (col1 primary key)
    object id primary key;
    Table created.
    ORA-2303 results if attempt to drop type with dependencies
    SQL> drop type object_type;
    drop type object_type
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependents
    위의 queery 1,2,3을 이용하여 object type dependency을 확인한다.
    -- Find nested tables utilizing object type
    SQL> select owner, parent_table_name, parent_table_column
    from dba_nested_tables
    where (table_type_owner, table_type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = 'SCOTT'
    and elem_type_name = 'OBJECT_TYPE');
    OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
    SCOTT MASTER COL2_LIST
    -- Find VARRAYs utilizing object type
    SQL> select owner, parent_table_name, parent_table_column
    from dba_varrays
    where (type_owner, type_name) in
    (select owner, type_name
    from dba_coll_types
    where elem_type_owner = 'SCOTT'
    and elem_type_name = 'OBJECT_TYPE');
    OWNER PARENT_TABLE_NAME PARENT_TABLE_COLUMN
    SCOTT MASTER COL3_LIST
    -- Find object tables
    SQL> select owner, table_name
    from dba_object_tables
    where table_type_owner = 'SCOTT'
    and table_type = 'OBJECT_TYPE'
    and nested = 'NO';
    OWNER TABLE_NAME
    SCOTT OBJECT_TABLE
    참고)
    bulletin : 11576 처럼 utility을 이용하는 방법이 있다.
    우리는 여기서 주의하여야 할 것은 script $ORACLE_HOME/rdbms/admin/utldtree.sql
    을 내가 보고자 하는 user에서 돌려야 한다는 것이다.
    $sqlplus scott/tiger
    SQL> @$ORACLE_HOME/rdbms/admin/utldtree.sql
    SQL> exec deptree_fill('TYPE','SCOTT','OBJECT_TYPE');
    PL/SQL procedure successfully completed.
    SQL> select * from ideptree;
    DEPENDENCIES
    TYPE SCOTT.OBJECT_TYPE
    TYPE SCOTT.OBJECT_NTABLE
    TABLE SCOTT.MASTER
    TYPE SCOTT.OBJECT_VARRAY
    TABLE SCOTT.MASTER
    TABLE SCOTT.MASTER_COL2
    TABLE SCOTT.OBJECT_TABLE
    Reference Documents
    Korean bulletin : 11576
    <Note:69661.1>

    Hi Carsten,
    Thanks for the sharp hint. It works.
    However, when I create a table using the schema, it gives me this error:
    varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
    ERROR at line 14:
    ORA-02337: not an object type column
    Here is the script:
    CREATE TABLE CUSTOMMANIFEST (
    ID NUMBER PRIMARY KEY,
    DOC sys.XMLTYPE
    xmltype column doc
    XMLSCHEMA "http://www.abc.com/cm.xsd"
    element "CustomManifest"
    varray DOC."LISTOFMANIFESTPORTINFO"."MANIFESTPORTINFO"
    store as table MANIFESTPORTINFO_TABLE
    (primary key (NESTED_TABLE_ID, ARRAY_INDEX))
    organization index overflow
    varray DOC."LISTOFASSIGNEDNUMBER"."ASSIGNEDNUMBER"
    store as table ASSIGNEDNUMBER_TABLE
    (primary key (NESTED_TABLE_ID, ARRAY_INDEX))
    organization index overflow
    LISTOFASSIGNEDNUMBER itself is complexType and not sure where is the error....
    You may note there are more than two hierachy/levels...
    Thanks.

Maybe you are looking for