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
;

Similar Messages

  • 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.

  • 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?

  • 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>

  • Nested Table Problem

    Hello,
    I am using Oracle10g and TopLink 10.1. I would like to implement a table descriptor which has nested tables.
    When I try to read "root" table, I get error messages described below.
    Could anybody tell me what's wrong?
    Thanks,
    ***** [3 Tables] *****
    Table: PARENT
    Fields: PARENT_NO
    Table: CHILD
    Fields: CHILD_NO, PARENT_NO
    Table: CHILD_MASTER
    Fields: CHILD_NO, CHILD_NAME, etc.
    ***** [The relation between tables] *****
    Parent<---(OneToMany)--->Child<---(Multitable)--->ChildMaster
    *****   *****[/b]
    RelationalDescriptor descriptor = new RelationalDescriptor();
    descriptor.setJavaClass(Parent.class);
    descriptor.setTableName("PARENT");
    descriptor.setPrimaryKeyFieldName("PARENT_NO");
    descriptor.addTableName("CHILD");
    descriptor.addTableName("CHILD_MASTER");
    // OneToMany configuration
    OneToManyMapping oneToMany = new OneToManyMapping();
    oneToMany.setAttributeName("Child");
    oneToMany.setReferenceClass(Child.class);
    oneToMany.setTargetForeignKeyFieldName("PARENT_NO");
    descriptor.addMapping(oneToMany);
    // Multitable configuration
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression exp = builder.getField("CHILD.CHILD_NO").equal("CHILD_MASTER.CHILD_NO");
    descriptor.getDescriptorQueryManager().setMultipleTableJoinExpression(exp);
    // Read
    ReadObjectQuery query = new ReadObjectQuery("PARENT");
    UnitOfWork uow = toplinkSession.acquireUnitOfWork();
    uow.executeQuery(query);
    ***** [Resulting SQL] *****
    SELECT t0.PARENT_NO, t1.PARENT_NO, t2.PARENT_NO,...
    FROM PARENT t0, CHILD t1, CHILD_MASTER t2
    WHERE ((t1.PARENT_NO = t0.PARENT_NO) AND (t1.CHILD_NO = t2.CHILD_NO))
    ***** [Error Message] *****
    When I read "Parent",  I get following error...
    "T2" is "CHILD_MASTER" table which has no "PARENT_NO" field. I don't want select "CHILD_MASTER.PARENT_NO" because it doesn't exist!
    Exception[TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "T2"."PARENT_NO": Invalid Identifier
    Error Code: 904
    Query:ReadAllQuery(Parent)
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:290)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:581)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:441)
    Message was edited by:
            user601162                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Thank you for your reply. Maybe my explanation was confusing.
    >Parent should map to the PARENT table,
    Child should map the CHILD
    and ChildMaster should map to the CHILD_MASTER table.
    Exactly. What I want to do is "Parent has Child" using OneToMay, "Child has ChildMaster" using Multitable. I guess it's still unclear...
    Anyway, I appreciate your advice.

  • 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.

  • 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.

  • Problems with Whitespace using nested tables from eclipse dtp oracle plugin

    Hi,
    sending from eclipse to oracle xe fails if whitespace is used:
    Example1: Nested table in nested table
    adress_table_typ has another nested table in it
    that works
    CREATE TABLE x (
    i INTEGER PRIMARY KEY,
    adressen adress_table_typ
    ) NESTED TABLE adressen STORE AS adressen_nt (NESTED TABLE tels STORE AS tels_nt);
    inserting a newline fails
    CREATE TABLE x (
    i INTEGER PRIMARY KEY,
    adressen adress_table_typ
    ) NESTED TABLE adressen STORE AS adressen_nt
    (NESTED TABLE tels STORE AS tels_nt);
    Example2:
    Two nested tables
    CREATE TABLE x (
    i INT PRIMARY KEY,
    l_table_typ,
    m_table_typ
    ) NESTED TABLE laptops STORE AS laptop_nt NESTED TABLE interessen STORE AS interessen_nt;
    and then an insert
    INSERT INTO x VALUES (123456,
    l_typ(laptop_typ('123', 'netop'),
    laptop_typ('234', 'thinkpad'),     
    laptop_typ('345', 'iBook')),
    m_typ('a', 'b', 'c')
    which fails. Note that the INSERT works when copy&pasted to sqlplus. It also works if there is
    just one nested table.
    Am I doing somethig wrong or is this a bug in the eclipse data tools plugin?
    Regards
    - Peter
    PS; It is rather difficult to insert whitespace in that forum editor. Any possibility to have ascii?
    For a "whitespace" question rather important...

    A bit of an update on the original post. I was playing around with the plug-in xml file (e.g. eclipse\plugins\org.eclipse.jst.server.generic.oc4j_1.5.100.v20070608\buildfiles\oracle.10.1.3.xml). I changed the following from "deploy" to "redeploy" and it seems to be working once the applicatoin is initial deployed. Of course, I have to change it back to "deploy" if it is the first time the application is being deployed. However; I would still would like to resolve this if there is something out there that fixes this problem. Or if everything points to an enviornment problem, I can continue to play with it.
    <target name="deploy.j2ee.ear" depends="check.skip.ear.deploy" unless="skip.deploy">
    <antcall target="package.module.ear"/>
    <oracle:redeploy
    deployerUri="${deployer.uri}"
    userId="${oc4j.admin.user}"
    password="${oc4j.admin.password}"
    file="${server.publish.dir}/${module.name}.ear"
    deploymentName="${module.name}"
    bindAllWebApps="${oc4j.bind.website}"/>
    </target>

  • 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.

  • 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.

  • Problem when expanding Tree - Tree with nested table column

    Hi, i have created the tree using the Tree with nested table column.
    I have created a node called TREE_ROOT in the context.
    This node has few attributes which includes children_loaded, is_leaf, is_expanded.
    I have created the recursive node TREE_SUB for the above node TREE_ROOT.
    In the view, i have created the table with the master column. The above attributes have been mapped accordingly. I have created the action handler for load_children.
    In this action handler method, i receive the context_element correctly. In this method, i determine the children of the selected element and the resulting children are attached to this context_element.
    But the problem is: when i add elements to context_elements in the method load_children, these
    elements get added to the node TREE_ROOT as well.
    Please help.
    thanks and best regards,
    Pramod

    I just use some types defined in this user... Well, I hope you know what is the type definition of d_period_sec,
    don't you ? I didn't ask to provide all types existed now, only types you are
    using.
    Anyhow you have been granted with execute privilege for types you are using:
    SQL> conn tau_tll/tau_tll;
    Connected.
    SQL> create or replace type d_period_sec as object (date# date);
      2  /
    Type created.
    SQL> grant execute on d_period_sec to public with grant option;
    Grant succeeded.
    SQL> conn scott/tiger
    Connected.
    SQL> CREATE OR REPLACE TYPE unit_function AS OBJECT (
      2  xi NUMBER,
      3  yi NUMBER,
      4  xe NUMBER,
      5  ye NUMBER,
      6  xm NUMBER,
      7  ym NUMBER,
      8  v NUMBER,
      9  a NUMBER,
    10  f NUMBER,
    11  descr VARCHAR2 (20)
    12  );
    13  /
    Type created.
    SQL> grant execute on unit_function to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE unit_moving_point AS OBJECT
      2  (
      3  p tau_tll.d_period_sec, -- from user TAU_TLL
      4 
      5  m unit_function
      6  )
      7  /
    Type created.
    SQL> grant execute on unit_moving_point to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point_tab AS TABLE OF unit_moving_point;
      2  /
    Type created.
    SQL> grant execute on moving_point_tab to master;
    Grant succeeded.
    SQL> CREATE OR REPLACE TYPE moving_point AS OBJECT (u_tab moving_point_tab);
      2  /
    Type created.
    SQL> grant execute on moving_point to master;
    Grant succeeded.
    SQL> conn master/master
    Connected.
    SQL> CREATE TABLE MPOINTS (
      2  id NUMBER,
      3  mpoint scott.Moving_Point)
      4  NESTED TABLE mpoint.u_tab store as moving_tab;
    Table created.Rgds.

  • Problem with Nested Table

    I am trying to make a nested table receive an arbitrary number of values (from a shuttle) through a loop, and then insert the table into a table of nested table in my database. The problem I am having is that when I try to insert more than one value into the nested table, it will only insert the last item in the loop into the database. Thanks in advance.
    This is the code I used to create my objects:
    create or replace type OUTPUT_TY as object( ATTRIBUTE_ID Number(8) )
    create or replace type OUTPUTS_NT as table of OUTPUT_TY
    This is my actual code in ApEx:
    declare
    temp_NT OUTPUTS_NT;
    temp_TY OUTPUT_TY;
    temp Number(10);
    l_vc_arr2 htmldb_application_global.vc_arr2;
    begin
    temp_nt := outputs_nt();
    l_vc_arr2 := HTMLDB_UTIL.string_to_table (:P2_SHUTTLE, ':');
    FOR i IN 1 .. l_vc_arr2.COUNT
    LOOP
    temp_ty := output_ty(l_vc_arr2(i)) ;
    temp_NT:= outputs_nt(temp_ty);
    END LOOP;
    INSERT INTO OUTPUT_TEST values (temp_NT);
    commit;
    end;

    > temp_NT:= outputs_nt (temp_ty);You are not extending the nested table / collection, you are simply assigning an entirely new collection to it for each element of l_vc_arr2.
    Try something like...
    FOR i IN 1 .. l_vc_arr2.COUNT LOOP
       temp_ty := output_ty (l_vc_arr2 (i));
       temp_nt.EXTEND;
       temp_nt (temp_nt.LAST) := temp_ty;
    END LOOP;Or perhaps more succintly...
    FOR i IN 1 .. l_vc_arr2.COUNT LOOP
       temp_nt.EXTEND;
       temp_nt (temp_nt.LAST) := output_ty (l_vc_arr2 (i));
    END LOOP;

  • Problems updating a table.

    Hey, I'm writing a program to manage a mysql music library. So far everything is working ok, but I seem to have run into a wall. I have my user interface create a custom table model that displays my data on a frame. I want to have a refresh button that updates the table based on changes made to the database. I've been trying to figure this out for several hours now and haven't come up with anything useful. Anyone have any advice? I've searched the web pretty but haven't really come up with anything that helps me out. My main problem I guess is that I need to call a method that sends new data to the tablemodel but the table is inside of the user interface so I can't really call a method that refers to a table it doesn't have access to. So yeah. Sorry if I'm not being very clear. Thanks!

    Alright I don't know what's going on now. Here's my code:
    Edit:In my user interface class this is how it's declared:
    SongTableModel myTableModel = new SongTableModel();
        JTable table = new JTable(myTableModel);and then in my database update class:
    SongTableModel myTableModel;
       public DBCom(SongTableModel stm) {
            myTableModel = stm;
        }and a in my add song method I inserted this to update the tablemodel data.
    myTableModel.updateTable(getData());But when I run this I get a null pointer exception at that piece of code. It must be something simple but I can't figure it out.
    Here's the tablemodel update method:
       public void updateTable(ArrayList<Song> s) {
           songs = new ArrayList<Song>();
           songs.addAll(s);
           fireTableDataChanged();
       }Any ideas?
    Edited by: techgeek24 on Apr 25, 2008 9:48 PM

  • 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.

Maybe you are looking for

  • I need to see an important iCloud email from last year, but it's not in my inbox

    I Need to read an important email that was sent to me last year. But after a couple months the read emails disappear from my inbox. Is there still a way to read it again. The email provider I use is @icloud.com

  • Best book for graphics design

    Hi my name is Aby. I am from India. I am working as a graphics designer in a start up company. I have not done any course in designing. I learnt of my own by seeing youtube videos and examples. I really want to learn professional designing, for which

  • Scripting charts in illustrator

    I work in the graphics department at the Financial Times. As you might imagine we generate a large amount of basic charts. We have a custome written javascript plugin called Ilex that takes an excel spreadsheet and given variables such as single colu

  • 808 Belle FP2

    Is it me or is "Swipe to unlock" rather slow as missing tap to unlock already? Prefer not to use spring loaded "lock-key" as probably first component to fail! Happy to have helped forum with a Support Ratio = 42.5

  • Cirrus fallback to RTMP

    We've deployed an application that uses Cirrus, but have found that a number of people are having issues connecting (I believe it's to do with their routers blocking the UDP packets). Is there a way we can get the application working for the users wi