XSU bug? update nested tables

crashed if locale RUSSIAN and update varchar2 contain simbols: " and :
oracle.xml.sql.OracleXMLSQLException: Идентификатор привязки должен иметь ненулевую длину.     at oracle.xml.sql.core.OracleXMLConvert.getSchema(OracleXMLConvert.java:2885)     at oracle.xml.sql.query.OracleXMLQuery.getXMLSchema(OracleXMLQuery.java:539)
JDK 1.4.1_01 latest XSU oracle 9.2 Win2k

Would you send me the sample test case? We will fix it if it is a bug.

Similar Messages

  • How to update Nested tables with xsu

    Hello,
    I have three tables.
    1) DEPARTMENT_TAB
    2) EMPLOYEE_TYP
    3) ADDRESS_TYP
    ADDRESS_TYP is a collection and it is nested inside EMPLOYEE_TYP.
    EMPLOYEE_TYP is a collection and it is nested inside DEPARTMENT_TAB.
    created with below scropt
    CREATE TYPE ADDRESS_TYP AS OBJECT (CITY VARCHAR2(10), STATE VARCHAR2(2));
    CREATE TYPE ADDRESS_TYP_NT AS TABLE OF ADDRESS_TYP;
    CREATE TYPE EMPLOYEE_TYP AS OBJECT (EMPNO NUMBER(4), ENAME VARCHAR2(10), ADDRESS_VAR ADDRESS_TYP_NT);
    CREATE TYPE EMPLOYEE_TYP_NT AS TABLE OF EMPLOYEE_TYP;
    CREATE TABLE DEPARTMENT_TAB (DEPTNO NUMBER(4), DNAME VARCHAR2(10), EMPLOYEE_VAR EMPLOYEE_TYP_NT)
         NESTED TABLE EMPLOYEE_VAR STORE AS EMPLOYEE_TAB
         ( NESTED TABLE ADDRESS_VAR STORE AS ADDRESS_TAB);
    I inserted two rows in DEPARTMENT_TAB and their nested tables using normalsql. and i generated below xml content using XSU java API
    oracle.xml.sql.query.OracleXMLQuery
    My Question is How to UPDATE a row in ADDRESS_TAB using XSU java API
    oracle.xml.sql.dml.OracleXMLSave.
    (When i was trying to update address_tab nested table's row with xml input file. it is deleting other existing rows)
    Thanks.

    Why do you say it does not work?

  • Update Nested Table Problem

    Hi All,
    I have a update problem in nested table.
    Below is my query:
    CREATE OR REPLACE TYPE TRACER.SEARCH_DATA AS TABLE OF VARCHAR2(20);
    UPDATE TRACER_SEARCH_SCHEDULE_LOT_NUM
    SET NOT_FOUND_SOR_LOT_NUM = SEARCH_DATA(
    SELECT
    COLUMN_VALUE
    FROM
    TABLE (SELECT SORTING_LOT_NUMBER FROM TRACER_SEARCH_SCHEDULE_LOT_NUM WHERE JOB_ID = 8)
    WHERE
    TRIM(COLUMN_VALUE) NOT IN (SELECT DISTINCT (SORTING_LOT_NUMBER) FROM SEARCH_SCHEDULE_RESULT_LOT_NUM WHERE JOB_ID = 8)
    ) WHERE JOB_ID = 8;
    ORA-00936: missing expression
    or I try as following
    DECLARE
    sor_lot_num_not_found SEARCH_DATA :=
    SEARCH_DATA
    SELECT
    FROM
    TABLE (SELECT SORTING_LOT_NUMBER FROM TRACER_SEARCH_SCHEDULE_LOT_NUM WHERE JOB_ID = 8)
    WHERE
    TRIM(COLUMN_VALUE) NOT IN (SELECT DISTINCT (SORTING_LOT_NUMBER) FROM SEARCH_SCHEDULE_RESULT_LOT_NUM WHERE JOB_ID = 8)
    BEGIN
    UPDATE TRACER_SEARCH_SCHEDULE_LOT_NUM SET NOT_FOUND_SOR_LOT_NUM = sor_lot_num_not_found WHERE JOB_ID = 8;
    END;
    ORA-06550: line 5, column 9:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( ) - + case mod new not null others <an identifier>
    table avg count current exists max min prior sql stddev sum
    variance execute multiset the both leading trailing forall
    merge year month DAY_ hour minute second timezone_hour
    timezone_minute timezone_region timezone_abbr time timestamp
    interval date
    <a string literal with character set specificat
    ORA-06550: line 11, column 5:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    ; for and or group having intersect minus order start union
    where connect
    ORA-06550: line 14, column 4:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted d
    I have try on the Select Statement, it work. So is it the way that I assign data from nested table and update method is wrong?
    Edited by: skymonster84 on Mar 8, 2011 5:12 PM

    Hi,
    I think MULTISET operators might interest you.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/operators006.htm
    Not tested :
    UPDATE tracer_search_schedule_lot_num
    SET not_found_sor_lot_num =
          sorting_lot_number
          MULTISET EXCEPT ALL
          CAST(
            MULTISET(
              SELECT distinct sorting_lot_number
              FROM search_schedule_result_lot_num
              WHERE job_id = 8
            AS search_data
    WHERE job_id = 8
    ;

  • Possible bug? Nested tables and quantity fields in the nested table.

    Hey guys,
    I have witnessed a weird bug, maybe someone can clarify this for me.
    1. Create a nested table. The inner table contains a quantity field of type DZIEME (FROM VBAP-ZIEME).
    2. Create your interface and just put this table in the import section. Try to activate. It will work.
    3. Create an adobe form for it and a program and execute it. You'll get a short dump saying that VBAP-ZIEME is unknown and that there are errors in the dynamically generated function.
    Second test.
    1. Create a nested table. The outer table contains a quantity field of type DZIEME (FROM VBAP-ZIEME).
    2. Create your interface and just put this table in the import section. Try to activate. It will NOT work.
    You have to make the addition of the quantity fields in Currency/Quantity Fields.
    From this I see that the checker, doesn't look into nested tables for quantity/currency fields and just activates the interface.
    Third test
    1. Create a nested table. The inner table contains a quantity field of type DZIEME (FROM VBAP-ZIEME).
    2. Create your interface:
    2.a. Put this table in the import section.
    2.b. Declare the nested Quantity field in the Currency/Quantity Fields section, using the autofiller (the buttons to the right of the field)
    2.c Try to activate. It will work.
    3. Create an adobe form for it and a program and execute it. You'll get a short dump which for some reason has no info.
    From this, I understand that the Currency/Quantity Fields section may not declare the quantity fields, from nested tables, correctly.
    What do you guys think? What am I doing wrong?
    Thanks,

    @Anne Kathrine P...
    By nested tables I mean creating table types, in the dictionary (se11) then in the interface>Import section adding a parameter X TYPE B_T.
    i.e.
    Structure A
    Table type of structure A, A_T
    Structure B containing a field of table type A
    Table type B of structure B, B_T.
    The issue can be easily solved for Z tables by changing the component type from quantity to decimal type.

  • Insert & update nested table

    Hi
    I have created one nested table with the follwing columns. I have to insert records into the nested table. And also I have to update the nested table. Please find below my table and getting error message.
    Please advose...!!
    SQL> create type details as object(
      2  basic number(7,2),
      3  da number(6,2),
      4  hra number(6,2),
      5  pf number(6,2),
      6  it number(6,2),
      7  gross number(7,2),
      8  ded number(6,2),
      9  net number(8,2));
    10  /
    Type created.
    SQL> create type details_t is table of details;
      2  /
    Type created.
    SQL> ed
    Wrote file afiedt.buf
      1  create table emp_tab(empno number(4),name varchar2(10),details_tab details_t)
      2* nested table details_tab store as empl_details
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null)))
    SQL> /
    Enter value for empno: 1
    Enter value for name: asdf
    Enter value for da: 120
    Enter value for hra: 130
    Enter value for pf: 120
    Enter value for it: 120
    old   1: insert into emp_tab values(&empno,'&name',details_t(details(&da,&hra,&pf,&it,null,null,null
    new   1: insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null)))
    insert into emp_tab values(1,'asdf',details_t(details(120,130,120,120,null,null,null)))
    ERROR at line 1:
    ORA-02315: incorrect number of arguments for default constructorCan I use '&' while inserting records into nested table? yes / no ?
    I have to update gross, ded, net columns also..!!
    Please help me..!!
    Regards
    A

    zep@dev>
    zep@dev> create type details as object
          2  (
          3      basic number(7, 2),
          4      da    number(6, 2),
          5      hra   number(6, 2),
          6      pf    number(6, 2),
          7      it    number(6, 2),
          8      gross number(7, 2),
          9      ded   number(6, 2),
         10      net   number(8, 2)
         11  )
         12  /
    Type created
    zep@dev> create type details_t is table of details
          2  /
    Type created
    zep@dev> create table emp_tab(empno number(4),name varchar2(10),details_tab details_t)
          2     nested table details_tab store as empl_details
          3  /
    Table created
    zep@dev> insert into emp_tab
          2  values
          3      (1,
          4       'asdf',
          5       details_t(details(120, 130, 120, 120, 1, 2, 3, 4)));
    1 row inserted
    zep@dev>
    zep@dev>   select *
          2      from table (select details_tab
          3                    from emp_Tab t
          4                   where t.empno = 1);
        BASIC       DA      HRA       PF       IT     GROSS      DED        NET
       120,00   130,00   120,00   120,00     1,00      2,00     3,00       4,00
    zep@dev> -- second object in the same empno = 1
    zep@dev>    insert into table
          2         (select details_tab
          3            from emp_Tab t
          4           where t.empno = 1)
          5     values
          6         (details(200, 230, 220, 220, 10, 11, 12, 13));
    1 row inserted
    zep@dev>
    zep@dev> select *
          2    from table (select details_tab
          3                  from emp_Tab t
          4                 where t.empno = 1);
        BASIC       DA      HRA       PF       IT     GROSS      DED        NET
       120,00   130,00   120,00   120,00     1,00      2,00     3,00       4,00
       200,00   230,00   220,00   220,00    10,00     11,00    12,00      13,00
    zep@dev>
    zep@dev> update table (select details_tab
          2                  from emp_Tab t
          3                 where t.empno = 1)
          4     set gross = nvl(basic,0) + nvl(da,0) + nvl(hra,0),
          5         ded   = nvl(pf,0) + nvl(it,0),
          6         net   = nvl(gross,0) - nvl(ded,0)
          7   where basic = 120;
    1 row updated
    zep@dev>
    zep@dev> select *
          2    from table (select details_tab
          3                  from emp_Tab t
          4                 where t.empno = 1);
        BASIC       DA      HRA       PF       IT     GROSS      DED        NET
       120,00   130,00   120,00   120,00     1,00    370,00   121,00      -1,00
       200,00   230,00   220,00   220,00    10,00     11,00    12,00      13,00
    zep@dev>

  • How to update nested table records ??

    Hi, I am just starting to write anything in PL/SQL and having some difficulties with basic syntax. Thanks for any help in advance.
    My problem is how to update collection (nested table of objects) with SQL statement. My nested table is not a column of regular table.
    Example:
    CREATE OR REPLACE TYPE tmpRec AS OBJECT(
    Col1 INT,
    Col2 INT
    CREATE OR REPLACE TYPE tmpTable IS TABLE OF tmpRec;
    DECLARE v tmpTable :=
    tmpMBATable(
    tmpRec(1,1),
    tmpRec(2,2),
    tmpRec(3,3),
    BEGIN
    --UPDATE TABLE(CAST(v AS tmpTable)) T SET T.Col2 = 1 WHERE T.Col1 =1;
    --UPDATE TABLE(v) T SET T.Col2 = 12 WHERE T.Col1 =1;
    --UPDATE (SELECT * FROM TABLE(v) )T SET T.Col2 = 12 WHERE T.Col =1;
    END;
    I am getting either
    PL/SQL: ORA-22841: DML is not allowed on PL/SQL Collections
    OR
    PL/SQL: ORA-00903 Bad table name.
    I found there is no problem when collection is a column of DB table (UPDATE TABLE(select collection_column from table) T SET T.Col2 = 12 WHERE T.Col1 =1;) but i want it to be just a collection without storing it in DB, is it possible ?
    Please help.

    898539 wrote:
    Thanks, for fast answer but my problem is more complex, maybe you can show me some workaround i try to use collection but maybe i should do something else...A complex problem does not mean a complex solution. In fact, complex problems should ideally be solved by breaking the complexity down into simpler components and then solving each of these in turn.
    As far as nested tables go? An interesting feature. But one that I will need a lot of convincing and justification for to consider for a production system. There are some major limitations with using nested tables. And these do not exist when using the simpler form of a standard relational child table instead.
    I am migrating from Sybase Adaptive Server Enterprise and searching for sollution for something we used temporary tables for so far.Temporary tables in Sybase are typically used to prevent concurrency issues (readers and writers blocking one another). Thus make a temp copy of the data and do not prevent concurrent access to the source data itself.
    These reasons simply do not exist in Oracle. In most cases, using temporary tables in Oracle simply because that is how it was implemented in Sybase, would be fundamentally flawed.
    Oracle is not Sybase. It does a very poor imitation of Sybase.
    I need a collection that can store some data and I need to be able to use it as a table so I can join to it via SQL query or call some DML on it.Why do you need a collection? The best place for data in Oracle is inside a table. Not inside a collection - especially not if that collection resides in PGA memory in the PL/SQL engine.
    In my store procedure I am updating, deleteing and inserting some data to it depends on context.What context? Oracle supports context namespaces - often used for virtual private database (VPDB) implementations. If you are referring to scope instead - there are a number of ways that Oracle supports scope too.
    The bottom line is that you should not approach this problem with "+how do I convert this Sybase method into an Oracle method+". Instead you need to look at the business requirement that the Sybase method addresses and then determine how best to address that requirement using Oracle.

  • Tables in memory (Nested tables ?)

    For performance reasons, I would like to insert, update, etc...
    a table in memory. Can I use a nested table as if it was a
    normal table ? Can I do updates on nested tables with values
    from normal database tables ??
    Statement like : Update <nested-table> set <nested-
    table>.x=<value> where <nested-table>.y = <normal-table>.y
    Thanks for a quick response.

    The answer is yes and no.
    A nested table is a "collection" and can be referenced in a SQL
    statement using the pseudo-functions THE, CAST, MULTISET and
    TABLE. The nested table and varray collections can be a column
    in a database table (Oracle8) and are persistent. SQL
    statements cannot act on memory held nested tables, varray and
    index-by collections, which are transient. Index-by collections
    are same as the older PL/SQL tables.
    SQL statements cannot operate directly on transient collections.
    For speed you can define an index-by collection as a table of
    rowtype, and move data back and forth from database tables and
    memory held tables using SQL. Records and index-by tables are
    more efficient in Oracle 8 than in Oracle 7
    In PL/SQL you can use replacement (:=) on the record or
    record.column of the rowtype index-by collection. The downside
    is you have to keep track of your own indexing which is only
    BINARY_INTEGER, no SELECT, UPDATE, INSERT using FROM and WHERE
    on transient collections. This works in Oracle 7 also.
    Good Luck.

  • InsertXML nested table

    Hello, I'm trying to insert to nested table xml clob using DBMS_XMLSave.insertXML.
    But xsu inserts to nested table for each row the same data !
    Are there any limitation to use DBMS_XMLSave.insertXML for nested table ?
    This is the xml I'm trying to insert, table dept have the same structure as xml with nested table emplist.
    (xml is generated with DBMS_XMLQuery ...,)
    | <ROWSET>
    | <ROW num="1">
    | <DEPTNO>1</DEPTNO>
    | <EMPLIST>
    | <EMPLIST_ITEM>
    | <EMPNO>1</EMPNO>
    | <ENAME>pkdahle</ENAME>
    | <SALARY>10</SALARY>
    | <EMPADDR>
    | <STREET>u</STREET>
    | <CITY>c</CITY>
    | <STATE>s </STATE>
    | <ZIP>z</ZIP>
    | </EMPADDR>
    | </EMPLIST_ITEM>
    | <EMPLIST_ITEM>
    | <EMPNO>2</EMPNO>
    | <ENAME>pkahle2</ENAME>
    | <SALARY>101</SALARY>
    | <EMPADDR>
    | <STREET>us</STREET>
    | <CITY>cc</CITY>
    | <STATE>sc</STATE>
    | <ZIP>zc</ZIP>
    | </EMPADDR>
    | </EMPLIST_ITEM>
    | </EMPLIST>
    | </ROW>
    | <ROW num="2">
    | <DEPTNO>2</DEPTNO>
    | <EMPLIST>
    | <EMPLIST_ITEM>
    | <EMPNO>1</EMPNO>
    | <ENAME>pkdahle</ENAME> -- this won't be saved in emplist (ename form previous row num=1 will be saved)
    | <SALARY>10</SALARY>
    | <EMPADDR>
    | <STREET>u</STREET>
    | <CITY>c</CITY>
    | <STATE>s </STATE>
    | <ZIP>z</ZIP>
    | </EMPADDR>
    | </EMPLIST_ITEM>
    | <EMPLIST_ITEM>
    | <EMPNO>2</EMPNO>
    | <ENAME>pkahle2</ENAME>
    | <SALARY>101</SALARY>
    | <EMPADDR>
    | <STREET>us</STREET>
    | <CITY>cc</CITY>
    | <STATE>sc</STATE>
    | <ZIP>zc</ZIP>
    | </EMPADDR>
    | </EMPLIST_ITEM>
    | </EMPLIST>
    | </ROW>
    | </ROWSET>
    Thank's

    I've created a simple example :
    1.Create types and table.
    2.Fill table with sample data
    3.Run queryCtx := DBMS_XMLQuery.newContext('select * from TestTable'); to generate XML
    4.delete testtable
    5.Run rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); with the generated xml.
    6.The table testtable will have 2 rows with the same 1 row collection xlist !!!
    CREATE OR REPLACE TYPE Test_Type
    AS OBJECT (
    x number
    create or replace type Test_List_Type as table of Test_Type
    create table TestTable (
    XX number,
    XLIst Test_List_Type
    nested table XLIst store as TestTable_XLIst_NEST
    insert into
    testtable
    (xx,xlist)
    values
    (1,Test_List_Type (test_type(10)))
    insert into
    testtable
    (xx,xlist)
    values
    (1,Test_List_Type (test_type(10)))
    insert into
    testtable
    (xx,xlist)
    values
    (2,Test_List_Type (test_type(20),test_type(21),test_type(22),test_type(23)))
    script to insert xml
    declare
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    xmldoc clob;
    -- xxslt clob;
    begin
    select cclob into xmldoc from cc.ka_clob; -- (I've stored xml in this table)
    insCtx := DBMS_XMLSave.newContext('testtable'); -- get the context handle
    DBMS_XMLSave.Setignorecase(insctx,1);
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    commit;
    end;

  • How to update a column in a nested table for a given record in the master t

    Hi I have translations for all attributes of an item stored as a nested table
    CREATE OR REPLACE TYPE T_ITM_ATTR AS OBJECT(
    ATTR_NM VARCHAR2(30),
    ATTR_VAL VARCHAR2(200 CHAR),
    ATTR_STS_BL NUMBER(1))
    INSTANTIABLE
    FINAL
    CREATE OR REPLACE TYPE T_ITM_ATTRIBUTES AS TABLE OF T_ITM_ATTR;
    CREATE TABLE XGN_MOD_ITEMS_T
    IDS NUMBER,
    MOD_IDS NUMBER NOT NULL,
    MOD_ITM_IDS NUMBER NOT NULL,
    LGG_ID VARCHAR2(3 CHAR) NOT NULL,
    ITM_TYPE VARCHAR2(50 CHAR) NOT NULL,
    ITM_NM VARCHAR2(50 CHAR) NOT NULL,
    ITM_BLOCK VARCHAR2(50 CHAR),
    ITM_ATTR T_ITM_ATTRIBUTES,
    ITM_COL1 VARCHAR2(1 CHAR),
    ITM_DSC VARCHAR2(100 CHAR),
    CREATED_BY VARCHAR2(30 CHAR) DEFAULT USER NOT NULL,
    CREATION_DATE DATE DEFAULT SYSDATE NOT NULL,
    LAST_UPDATED_BY VARCHAR2(30 CHAR),
    LAST_UPDATE_DATE DATE
    NESTED TABLE ITM_ATTR STORE AS NESTED_ITM_ATTR_T
    TABLESPACE XGN4_TAB
    PCTUSED 40
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT
    What I want to do is to update only the attr_val of each item to a value coming from a temporary table where the user inserted his translations
    So how can I update ?
    this doesn't work since I have to know the previous value?
    update table(
    select t2.attr_val
    from XGN_MOD_ITEMS_T t1, table(t1.itm_attr) t2
    where t1.mod_itm_ids=160) attr
    set value(attr) = 'Profil'
    where value(attr) = 'Profile'
    This updates all occurences for all entries wich doesn't work either because I have for each language another record
    UPDATE /*+ NESTED_TABLE_GET_REFS */
    NESTED_ITM_ATTR_T
    SET attr_val = 'SHIT'
    WHERE attr_val = 'Profile'

    http://www.psoug.org/reference/nested_tab.html
    Look for UPDATE. There is a working demo on the page.
    That said nested tables are not a good place to store data. Reconsider using relational tables with, if necessary, object views.

  • Update a nested table

    Hi guys,
    I have following nested table and I need to perform an update to the BRIDGE_GEOM nested table. Can somebody help me?
    CREATE TABLE BRIDGE
    BRIDGE_GEOM MDSYS.SDO_GEOMETRY,
    MSLINK NUMBER(10) NOT NULL,
    CREATE INDEX BRIDGE_RTREE_X ON BRIDGE
    (BRIDGE_GEOM)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS('SDO_DIMENSIONALITY=3 SDO_FANOUT=35 SDO_INDX_DIMS=2');
    CREATE OR REPLACE
    TYPE MDSYS.SDO_POINT_TYPE AS OBJECT (X NUMBER,Y NUMBER,Z NUMBER)
    CREATE OR REPLACE
    TYPE MDSYS.SDO_ELEM_INFO_ARRAY AS VARRAY (1048576) of NUMBER
    CREATE OR REPLACE
    TYPE MDSYS.SDO_ORDINATE_ARRAY AS VARRAY(1048576) OF NUMBER
    CREATE OR REPLACE
    TYPE MDSYS.SDO_GEOMETRY AS OBJECT (
    SDO_GTYPE NUMBER,
    SDO_SRID NUMBER,
    SDO_POINT SDO_POINT_TYPE,
    SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY,
    SDO_ORDINATES SDO_ORDINATE_ARRAY)
    /

    Hi!
    Pls check the following code --
    update bridge
    set bridge_geom = MDSYS.SDO_GEOMETRY(5,
                       3,
                       SDO_POINT_TYPE(5,9,10),
                       SDO_ELEM_INFO_ARRAY(5),
                       SDO_ORDINATE_ARRAY(9)
    where MSLINK = 15
    /Though i got error while running ur script --
    SQL> CREATE OR REPLACE
      2  TYPE MDSYS.SDO_GEOMETRY AS OBJECT (
      3  SDO_GTYPE NUMBER,
      4  SDO_SRID NUMBER,
      5  SDO_POINT SDO_POINT_TYPE,
      6  SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY,
      7  SDO_ORDINATES SDO_ORDINATE_ARRAY)
      8  /
    CREATE OR REPLACE
    ERROR at line 1:
    ORA-02303: cannot drop or replace a type with type or table dependentsN.B.: Not Tested.....
    Regards.
    Satyaki De.

  • Nested Tables and XSU

    Does anyone know if XSU supports the use of nested tables?
    I have looked at the examples in the documentation that show how to use XSU with an object-relational schema. They work great if you have a fairly simple schema, (no nested tables). The XML documents I am trying to get into my database are a bit more complex and contain collections of repeating elements. I have created a schema that includes nested tables to support these repeating elements. My problem is when I try to access the object table via XSU. As long as I don't reference the nested table columns all works fine. Am I trying to do something that is not supported by XSU?

    Steve,
    What release is your database server?
    XSU should work fine with nested tables. Did you check out samples in http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96621/adx08xsu.htm#1014730?
    Regards,
    Geoff

  • HOw to improve insert/update/select  for nested table.

    Hi All,
    I think this is my second thread for nested table.
    i just want to know what are the different ways available to improve the insert/update/select operation on Nested table.
    Thanks in advance.

    By not using a nested table for data storage in the first place...
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:8135488196597
    Perhaps Parallel Query/DML might give some relief.

  • Updating a nested table of references

    Hi,
    Can anyone tell me the syntax for updating a nested table of references?
    For example:
    CREATE TYPE purchaseorder_ob AS OBJECT(
    order_number NUMBER(6),
    shipping_date DATE,
    city VARCHAR2(30),
    orderlineitem orderlineitem_va);
    CREATE TYPE refpurchaseorder_tab AS TABLE of REF purchaseorder_ob;
    CREATE TYPE customer_ob AS OBJECT(
    customer_number NUMBER(5),
    customer_name VARCHAR2(50),
    city VARCHAR2(30),
    reftopurchaseorder refpurchaseorder_tab)
    NOT FINAL;
    CREATE TABLE customer_t OF customer_ob (customer_number Primary key)
    NESTED TABLE reftopurchaseorder STORE AS reftopurchaseorder_nt;
    UPDATE customer_t
    SET reftopurchaseorder = ???????
    WHERE customer_number = 1;
    What do I put for ??????
    Any help would be greatly appreciated.
    Fernanda.

    Type declarations are not complete, nevertheless for example:
    SQL> CREATE TYPE orderlineitem_va AS VARRAY(10) of NUMBER(10);
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE purchaseorder_ob AS OBJECT(
      2  order_number NUMBER(6),
      3  shipping_date DATE,
      4  city VARCHAR2(30),
      5  orderlineitem orderlineitem_va);
      6  /
    Type created.
    SQL> CREATE TYPE refpurchaseorder_tab AS TABLE of REF purchaseorder_ob;
      2  /
    Type created.
    SQL> CREATE TYPE customer_ob AS OBJECT(
      2  customer_number NUMBER(5),
      3  customer_name VARCHAR2(50),
      4  city VARCHAR2(30),
      5  reftopurchaseorder refpurchaseorder_tab)
      6  NOT FINAL;
      7  /
    Type created.
    SQL> CREATE TABLE customer_t OF customer_ob (customer_number Primary key)
      2  NESTED TABLE reftopurchaseorder STORE AS reftopurchaseorder_nt;
    Table created.
    SQL> desc customer_t
    Name                                      Null?    Type
    CUSTOMER_NUMBER                           NOT NULL NUMBER(5)
    CUSTOMER_NAME                                      VARCHAR2(50)
    CITY                                               VARCHAR2(30)
    REFTOPURCHASEORDER                                 REFPURCHASEORDER_TAB
    SQL> insert into customer_t values(customer_ob(1,'James','Dublin',null));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create table purchase_t of purchaseorder_ob;
    Table created.
    SQL> insert into purchase_t values(purchaseorder_ob(1,sysdate,'London',null));
    1 row created.
    SQL> insert into purchase_t values(purchaseorder_ob(2,sysdate,'London',null));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select ref(p) from purchase_t p;
    REF(P)
    000028020918B2D893716E47CE91690542A6898D71432C6F6282764771BFD25979B8BCB3DB01000C
    2D0000
    0000280209EA531A4F6833495A9AF846C57A846A4D432C6F6282764771BFD25979B8BCB3DB01000C
    2D0001
    SQL> update customer_t
      2  set REFTOPURCHASEORDER =
      3  CAST(MULTISET(SELECT REF(p) FROM purchase_t p) AS REFPURCHASEORDER_TAB)
      4  WHERE customer_number = 1
      5  /
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from customer_t;
    CUSTOMER_NUMBER CUSTOMER_NAME
    CITY
    REFTOPURCHASEORDER
                  1 James
    Dublin
    REFPURCHASEORDER_TAB(000022020818B2D893716E47CE91690542A6898D71432C6F6282764771B
    FD25979B8BCB3DB, 0000220208EA531A4F6833495A9AF846C57A846A4D432C6F6282764771BFD25
    979B8BCB3DB)Rgds.

  • Nested table updation in FOR Cursor loop

    Hello,
    I have nested table as follows:
    SQL> desc fp
    Name Null? Type
    ORDER_NUM NOT NULL VARCHAR2(10)
    ORDER_TIE_NUM NOT NULL VARCHAR2(10)
    FACILITY NOT NULL VARCHAR2(10)
    ON_SHORTS NUMBER(2)
    ACTIVE_SHORTS NUMBER(2)
    PARTS DPM_TRANSFORM_CODE.FP_SLC_SHORT
    FIRST_SHORT DATE
    LAST_SHORT DATE
    SQL> desc DPM_TRANSFORM_CODE.FP_SLC_SHort
    DPM_TRANSFORM_CODE.FP_SLC_SHort TABLE OF DPM_TRANSFORM_CODE.FP_SHORT_INFO
    Name Null? Type
    PART_NUM VARCHAR2(7)
    AREA VARCHAR2(7)
    PART_QTY NUMBER(3)
    ON_SHORT_CNT NUMBER(4)
    OFF_SHORT_CNT NUMBER(4)
    FIRST_DATE DATE
    LAST_DATE DATE
    UPDATE TABLE(SELECT PARTS FROM DPM_REPORTING.FP WHERE ORDER_NUM = P.ORDER_NUM AND ORDER_TIE_NUM = P.ORDER_TIE_NUM) PARTS
    SET PARTS.OFF_SHORT_CNT = PARTS.OFF_SHORT_CNT + 1
    WHERE PARTS.last_date < SYSDATE - 2/24;
    This Update Statement is in FOR Cursor Loop
    where select statement for the cursor is
    "SELECT ORDER_NUM,ORDER_TIE_NUM,PARTS FROM DPM_REPORTING.FP WHERE FACILITY = 'PN1'"
    This select statement generates 20000 records & due to which the Update statement gets executed that many times inside FOR loop.The Procedure has become quite slow due to this.
    Please help.
    Thanks,
    Rekha

    You could do it all in one sql update statement, without any pl/sql or cursor or looping:
    UPDATE fp t1
    SET    t1.parts =
           CAST (MULTISET (SELECT part_num, area, part_qty, on_short_cnt,  
                                  CASE WHEN last_date < SYSDATE - 2/24
                                       THEN off_short_cnt + 1
                                       ELSE off_short_cnt
                                  END,  
                                  first_date, last_date
                           FROM   TABLE (SELECT parts
                                         FROM   fp
                                         WHERE  facility = 'PN1'
                                         AND    order_num = t1.order_num
                                         AND    order_tie_num = t1.order_tie_num))    
                 AS fp_slc_short)
    WHERE  t1.facility = 'PN1'
    /

  • Nested table update gets ORA-00904 with ExecuteSQL, error-free in TOAD

    I'm trying to run an UPDATE query through the ExecuteSQL method
    of the oraDatabase object. The catch seems to be that this one
    affects a nested table (field to be updated is a table itself).
    This SQL runs perfectly in T.O.A.D. ...
    UPDATE B457.AIRLINE a SET
    a.rental_cust_code=B457.RENTCUSTCODELIST(rentcustcodes
    ('45645'),rentcustcodes('1234'),rentcustcodes('234234')) WHERE
    a.AIRLINE_CODE='RCR'
    ...but, it produces the "SQL execution error, ORA-00904: invalid
    column name" when run using ExecuteSQL.
    Do I need to use a different syntax?

    and the complete example
    SQL> create or replace TYPE t_indirizzo AS OBJECT (
      2  via VARCHAR(45),
      3  numero NUMBER,
      4  cap INTEGER(5),
      5  citta VARCHAR(30),
      6  provincia VARCHAR(30),
      7  regione VARCHAR(30)
      8  );
      9  /
    Type created.
    SQL>
    SQL>
    SQL> create or replace TYPE t_telefono AS OBJECT (
      2  num_tel NUMBER(15)
      3  );
      4  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_listaTelefono AS TABLE OF t_telefono
      2  /
    Type created.
    SQL>
    SQL> create or replace TYPE t_cliente AS OBJECT (
      2  cod_cliente NUMBER(8),
      3  indirizzo t_indirizzo,
      4  email VARCHAR(30),
      5  telefono t_listaTelefono
      6  ) NOT FINAL;
      7  /
    Type created.
    SQL>
    SQL> CREATE TABLE cliente OF t_cliente(
      2  cod_cliente NOT NULL,
      3  indirizzo NOT NULL,
      4  email NOT NULL,
      5  PRIMARY KEY (cod_cliente)
      6  ) nested table telefono store as numTelCli_tab
      7  return as value
      8  /
    Table created.
    SQL>

Maybe you are looking for