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.

Similar Messages

  • Nested tables and memory usage (ORA-04030 error)

    Dear All,
    I have table with approximately 5,000,000 records
    and try to Bulk Collect part of it into nested table in PL/SQL, the code is bellow
    Declare
         Type TcardRec Is Record(
              serno Pls_Integer,
              numberx Char(16),
              caccserno Pls_Integer
         Type TcardList Is Table Of TcardRec;
         fcardInfo TcardList;
    Begin
    Select c.serno, substr(c.numberx,1,16), c.caccserno
    Bulk Collect Into fcardinfo
    From cardx c;
    End;
    After reading approx. 80% it fails with error
    ORA-04030: out of process memory when trying to allocate 16396 bytes (koh-kghu call ,pmucalm coll)
    I 2G memory, is it realy no enough?
    How can I tune memory usage for collection?
    How can I estimate the maximum size of the collection the will fit into memory?
    Thank you in advance for any help
    Artem

    Declare it as a cursor.
    Open the cursor.
    Use fetch bulk collect with the limit option in the loop.
    In your case, you could do like:
    Declare
    Cursor c1 is
    Select c.serno, substr(c.numberx,1,16), c.caccserno
    From cardx c;
    TcardList Is Table Of c1%rowtype;
    fcardInfo TcardList;
    Begin
    Open c1;
    Loop
    Fetch c1 Bulk Collect Into fcardInfo Limit 10000;
    Exit when c1%notfound;
    -- Do some processing here.
    End Loop;
    Close c1;
    End;
    I hope this helps.

  • Aborted : development component "tc/webadministrator/abapco

    hi
    while deploying through SDM i getting the following error
    starting deployment of tc/webadministrator/abapco
    Aborted : development component "tc/webadministrator/abapco '/sap.com/SAP AG'/'7.0010.200.61020144811.0000 '/0':
    Caught exceptionduringduring application deployment from SAP J2EE engine's deploy service:
    java.rmiRemoteException:cannot deploy sap.com/tcwebadministratorabapco ..
    Reason: error while compiling:
    Compilation process error :java.io.IOException:cannot allocate memory nested exception is  com.sap.engine.services.ejb.exceptions.deployment.EJBfileGenerationException:error while compiling: compilation process ava.io.IOException:cannot allocate memory
    thks&rgds
    George Varghese

    Hi George,
    I'm facing the same issue. Could you find a solution for this ?
    Thanks
    Frank

  • Performance impact using nested tables and object

    Hi,
    Iam using oracle 11g.
    While creating a package, iam using lot of nested tables created based on objects which will be passed between multiple functions in the package..
    Will it have any performance impact since all the data is stored in the memory.
    How can i measure the performance impact when the data grows ?
    Regards,
    Oracle User
    Edited by: user9080289 on Jun 30, 2011 6:07 AM
    Edited by: user9080289 on Jun 30, 2011 6:42 AM

    user9080289 wrote:
    While creating a package, iam using lot of nested tables created based on objects which will be passed between multiple functions in the package.. Not the best of ideas in general, in PL/SQL. This is not client code that can lay sole claim to most of the memory. It is server code and one of many server processes that need to share the available resources. So capitalism is fine on a client, but you need socialism on the server? {noformat} ;-) {noformat}
    Will it have any performance impact since all the data is stored in the memory.Interestingly yes. Usually crunching data in memory is better. In this case it may not be so. The memory used is the most expensive memory Oracle can use - the PGA. Private process memory. This means each process copy running that code, will need lots of memory.
    If you're not passing the data structures by reference, it means even bigger demands on memory as the data structure needs to be copied into the call stack and duplicated.
    The worse case scenario is that such code consumes so much free server memory, and make such huge demands on having that in pysical memory, it trashes memory management as the swap daemons are unable to keep up with the demand of swapping virtual memory pages into and out of memory. Most CPU time is spend by the swap daemons.
    I have seen servers crash due to this. I have seen a single PL/SQL process causing this.
    How can i measure the performance impact when the data grows ?Well, you need to look at the impact of your code on PGA memory. It is not SQL performance or I/O performance that is a factor - just how much private process memory your code needs in order to execute.

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

  • Nested tables questions

    I ve been using nested tables ( with the 'index by' clause ).
    I understand that the created array is stored in the RAM memory ( and not in the database files ).
    1. Does this mean that my program might not run one day when the machine is running low on RAM ?
    2. If yes, will there be an exception or something ?
    3. I understand that the memory is freed when the 'session ends'. When does my session end ? ( Is it when my PROCEDURE/function ends or is it when I quit sqlplus )
    4. Are nested tables/collections thread safe ?
    If I declare a nested table within the procedure, and if the procedure is called simultaneously by two clients, will there be a problem ?
    Thanks

    1. Yes
    2. Yes, possibly "PLS-00996: out of memory" although there may be others
    3. PL/SQL does garbage collection at various times, including when your session ends (i.e. when you disconnect from Oracle) and when a variable goes out of scope (e.g. when a procedure ends). I don't think the full list of rules is documented.
    4. Yes, although I'm not sure what happens in connection pooling.

  • Nested Tables? Why do I need them?

    Hi! I am reading the PL/SQL reference about collections right now and I have reached the nested tables. And I can not understand the advantages of using them. There is an example there
    INSERT INTO department
    VALUES('English', 'Lynn Saunders', 'Breakstone Hall 205',
    CourseList('Expository Writing',
    'Film and Literature',
    'Modern Science Fiction',
    'Discursive Writing',
    'Modern English Grammar',
    'Introduction to Shakespeare',
    'Modern Drama',
    'The Short Story',
    'The American Novel'));
    So, what is the point of having nested table instead of two separate tables? I think it is a waste of memory, data duplication and problems related to it. Please tell me the real life example of useful use of nested tables. Thanks.

    A practical example of a nested table.
    I have written an application logging API in PL/SQL. Messages wind up being inserted via anonymous transactions into a relational table.
    This PL/SQL logging process also takes a snapshot of the PL/SQL call stack at that point in time and store the stack with the message as a column. The call stack itself is in fact a table. i.e. stack = (handle, object name and source code line number). Thus the STACK column in this table is a nested table.
    One could have used a separate table for the call stack (traditional parent-child relationship). However, there are absolutely nothing in common between the call stack of one message and that of another. One would never want to query all call stacks to find what was the code running at stack level 4, or what line number was used at stack level 2, etc.
    It is much easier to manage and query and maintain the call stack as a nested column (a "dedicated table") for a row as it only ever related to that row and nothing else.

  • What are nested Internal tables

    Hi Guru's,
    I am new to ABAP ...just trying to learn things.Can you please explain me what are nested internal tables and what is the purpose of nested internal table?where can it be used and why a header line is not written in a Nested Internal table...
    Kindly explain it (scenario where nested internal tables are used) with an example it will be helpful.
    Cheers,
    Priyanka

    Hi,
    When storing data in internal tables, you often use one internal table for each database you read.
    Each one contains some or all columns of the relevant database table. It is up to you whether
    you create an internal table with a flat structure for each database table or if you create, for
    example, internal tables with nested structures. If you have several tables, each one with a flat
    structure, you have to work with redundant key fields to link the tables. If, on the other hand, you
    use nested internal tables, you can store the data from the database tables hierarchically.
    Saving and processing very large amounts of data in internal tables has disadvantages. If you
    divide up the data into different internal tables, processing it can be very runtime-intensive, since
    the tables have to be processed individually. Furthermore, it requires a lot of storage space,
    since internal tables are not stored in compressed form. The system may even need to store the
    dataset outside of its working memory. This means that processing it takes even longer.
    An example of nested internal table:
    Assume the following program is linked to the logical database [Page 1163] F1S.
    REPORT DEMO.
    DATA: SUM TYPE I, CNT TYPE I.
    NODES: SPFLI, SFLIGHT, SBOOK.
    DATA: BEGIN OF WA_SBOOK,
    BOOKID TYPE SBOOK-BOOKID,
    SMOKER TYPE SBOOK-SMOKER,
    CLASS TYPE SBOOK-CLASS,
    LUGGWEIGHT TYPE SBOOK-LUGGWEIGHT,
    WUNIT TYPE SBOOK-WUNIT,
    END OF WA_SBOOK.
    DATA: BEGIN OF WA_SFLIGHT,
    FLDATE TYPE SFLIGHT-FLDATE,
    SBOOK LIKE TABLE OF WA_SBOOK,
    END OF WA_SFLIGHT.
    DATA: BEGIN OF WA_SPFLI,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    CITYFROM TYPE SPFLI-CITYFROM,
    CITYTO TYPE SPFLI-CITYTO,
    SFLIGHT LIKE TABLE OF WA_SFLIGHT,
    END OF WA_SPFLI.
    DATA TAB_SPFLI LIKE TABLE OF WA_SPFLI.
    START-OF-SELECTION.
    GET SPFLI.
    REFRESH WA_SPFLI-SFLIGHT.
    GET SFLIGHT.
    REFRESH WA_SFLIGHT-SBOOK.
    GET SBOOK.
    MOVE-CORRESPONDING SBOOK TO WA_SBOOK.
    APPEND WA_SBOOK TO WA_SFLIGHT-SBOOK.
    GET SFLIGHT LATE.
    MOVE-CORRESPONDING SFLIGHT TO WA_SFLIGHT.
    APPEND WA_SFLIGHT TO WA_SPFLI-SFLIGHT.
    GET SPFLI LATE.
    MOVE-CORRESPONDING SPFLI TO WA_SPFLI.
    APPEND WA_SPFLI TO TAB_SPFLI.
    END-OF-SELECTION.
    SORT TAB_SPFLI BY CITYFROM CITYTO CONNID.
    LOOP AT TAB_SPFLI INTO WA_SPFLI.
    SKIP.
    WRITE: / WA_SPFLI-CARRID,
    WA_SPFLI-CONNID,
    'from', (15) WA_SPFLI-CITYFROM,
    'to', (15) WA_SPFLI-CITYTO.
    ULINE.
    SORT WA_SPFLI-SFLIGHT BY FLDATE.
    LOOP AT WA_SPFLI-SFLIGHT INTO WA_SFLIGHT.
    SKIP.
    WRITE: / 'Date:', WA_SFLIGHT-FLDATE.
    WRITE: 20 'Book-ID', 40 'Smoker', 50 'Class'.
    ULINE.
    SORT WA_SFLIGHT-SBOOK BY CLASS SMOKER BOOKID.
    SUM = 0.
    CNT = 0.
    LOOP AT WA_SFLIGHT-SBOOK INTO WA_SBOOK.
    WRITE: / WA_SBOOK-BOOKID UNDER 'Book-ID',
    WA_SBOOK-SMOKER UNDER 'Smoker',
    WA_SBOOK-CLASS UNDER 'Class'.
    SUM = SUM + WA_SBOOK-LUGGWEIGHT.
    CNT = CNT + 1.
    ENDLOOP.
    ULINE.
    WRITE: 'Number of bookings: ', (3) CNT,
    / 'Total luggage weight:',
    (3) SUM, WA_SBOOK-WUNIT.
    ENDLOOP.
    ENDLOOP.
    Thanks.

  • Severe Pro*C / nested table error

    I am experiencing a nasty error which involves Pro*C accessing nested table columns. I am running Oracle 9.2.0.1.0 on Solaris 2.8 and using the GNU gcc compiler.
    In my examples, I will use the sample data which comes with Pro*C ($ORACLE_HOME/precomp/demo/sql/coldemo1.sql).
    This defines the following types and table (and also populates the table with sample data):
    CREATE TYPE city_t AS OBJECT (name CHAR(30), population NUMBER);
    CREATE TYPE citytbl_t AS TABLE OF city_t;
    CREATE TABLE county_tbl (name CHAR(30), cities citytbl_t)
    NESTED TABLE cities STORE AS citytbl_t_tbl;
    I have no problems running the sample program ($ORACLE_HOME/precomp/demo/proc/coldemo1.pc). Note that you must follow the instructions included in the comments of coldemo1.pc (manually execute the Oracle Type Translator, precompile, compile and link).
    The sample, however, merely retrieves and displays existing data. I would like my program to be able to insert new rows into county_tbl, including the nested table.
    I have the following code (for simplicitys sake, everything is in the main procedure):
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <sqlca.h>                                /* SQL Communications Area */
    #include <coldemo1.h>        /* OTT-generated header with C typedefs for the */
                                          /* database types city_t and citytbl_t */
    #define CITY_NAME_LEN    30
    #define COUNTY_NAME_LEN  30
    #define MAXCITIES 5
    void PrintSQLError()
      EXEC SQL WHENEVER SQLERROR CONTINUE;
      printf("SQL error occurred...\n");
      printf("%.*s\n", (int)sqlca.sqlerrm.sqlerrml,
             (CONST char *)sqlca.sqlerrm.sqlerrmc);
      EXEC SQL ROLLBACK RELEASE;
      exit(-1);
    int main(int argc, char *argv[])
      char * uid = "scott/tiger";
      citytbl_t *cityTable;
      OCIInd cityTableInd;
      char county[COUNTY_NAME_LEN + 1];
      city_t *city[MAXCITIES];
      city_t_ind *cityInd[MAXCITIES];
      char cname[CITY_NAME_LEN + 1];
      int cpop;
      int numCities = MAXCITIES;
      int i, tableSize;
      EXEC SQL WHENEVER SQLERROR DO PrintSQLError();
      EXEC SQL CONNECT :uid;
      /* to null-terminate strings */
      EXEC ORACLE OPTION (char_map=string);
      /* Allocate the required descriptors */
      EXEC SQL ALLOCATE :cityTable;
      EXEC SQL ALLOCATE :city:cityInd;
      strcpy(county,"MYCOUNTY");
      /* Create an array of city objects */
      EXEC SQL FOR :numCities OBJECT CREATE :city:cityInd;
      for(i=0;i<numCities;i++)
        sprintf(cname,"city%d", i);
        cpop = (i * 100);
        EXEC SQL OBJECT SET NAME, POPULATION OF :city[i] TO :cname, :cpop;
        cityInd[i]->_atomic = cityInd[i]->NAME = cityInd[i]->POPULATION = OCI_IND_NOTNULL;
      cityTableInd = OCI_IND_NOTNULL;
      EXEC SQL COLLECTION APPEND :city:cityInd TO :cityTable:cityTableInd;
      EXEC SQL INSERT INTO county_tbl (NAME, CITIES) VALUES (:county, :cityTable:cityTableInd);
      EXEC SQL FREE :city;
      EXEC SQL FREE :cityTable;
      EXEC SQL COMMIT RELEASE;
      return(0);
    }This works as expected, inserting one row into COUNTY_TBL, with name=MYCOUNTY, cities being a nested table containing five city elements.
    My problem occurs when I create a trigger on COUNTY_TBL which attempts to modify elements of the nested table column. Heres the trigger (in this case, we are converting each NAME element of the cities table to upper case):
    create or replace trigger biur_county
    before insert or update on county_tbl
    for each row
    when (new.cities is not null)
    BEGIN
    IF(:NEW.cities.COUNT > 0) THEN
    FOR i IN :NEW.cities.FIRST..:NEW.cities.LAST LOOP
    :NEW.cities(i).NAME := UPPER( :NEW.cities(i).NAME );
    END LOOP;
    END IF;
    END biur_county;
    From SQL*Plus, this works as expected:
    SQL> insert into county_tbl values ('ANOTHERCOUNTY',CITYTBL_T(CITY_T('city1',1),CITY_T('city2',2)));
    1 row created.
    SQL> select * from county_tbl where name='ANOTHERCOUNTY';
    NAME
    CITIES(NAME, POPULATION)
    ANOTHERCOUNTY
    CITYTBL_T(CITY_T('CITY1 ', 1), CITY_T('CITY2 ', 2))
    1 row selected.
    Note that the city names have been converted to upper case.
    If, however, I attempt to run the Pro*C program again, with the trigger enabled, I get a severe error:
    ORA-03113: end-of-file on communication channel
    This also creates entries in the alert log:
    Errors in file /space/oracle/product/9.2.0.1.0/admin/ATDEV/udump/atdev_ora_16790.trc:
    ORA-07445: exception encountered: core dump [0000000100C8EF7C] [SIGBUS] [Invalid address alignment] [0x400000006] [] []
    The trace file includes:
    Exception signal: 10 (SIGBUS), code: 1 (Invalid address alignment), addr: 0x400000006, PC: [0x100c8e
    f7c, 0000000100C8EF7C]
    *** 2002-12-11 15:51:25.469
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [0000000100C8EF7C] [SIGBUS] [Invalid address alignment]
    [0x400000006] [] []
    Current SQL statement for this session:
    insert into county_tbl (NAME,CITIES) values (:b0,:b1:b2)
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    38421f020 3 SCOTT.BIUR_COUNTY
    If I subsequently disable the trigger (or alter the trigger so that the contents of the nested table are not modified), all is well again.
    Has anyone else encountered a similar problem? I am assuming that the problem has something to do with the objects in Pro*C being transient and held in the object cache on the client. Perhaps I am doing something wrong in my program. Does anyone have any thoughts?
    Certainly there are ways around this problem (remove the trigger, for example, or perform inserts through a view / instead of trigger, etc), but I would like to have an explanation as to why my method is not working.
    Any insights would be greatly appreciated.

    HELLO!!!
    This problem reveals ONLY in DEBUG configuration (in RELEASE - all ok, but DEBUG is very important feature ;)) and operator
    new in my case have not an influence on this situation.
    I found a problem in other place when calling boxes=box.ptr();
    The boxes oracle class have a nested table. In C++ :
    class CBoxes : public oracle::occi::PObject {
    private:
    OCCI_STD_NAMESPACE::string BOXNAME;
    oracle::occi::Number BOXNUM;
    OCCI_STD_NAMESPACE::vector<CWidget*> WIDGETS;
    ptr() function calling readSQL method of CBoxes class:
    BOXNAME = streamOCCI_.getString();
    BOXNUM = streamOCCI_.getNumber();
    oracle::occi::getVector(streamOCCI_, WIDGETS);
    and getVector is:
    //cutted from occiObjects.h------------------------------
    template <class T>
    void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T> &vect)
    {OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;      
    getVectorOfPObjects( any,vec_pobj);//!!!!!!! :[  ]
    vect.clear();
    int size= vec_pobj.size();
    for( int i=0; i< size; i++)
    vect.push_back( (T)vec_pobj[i] );
    }//<- the destructor of vec_pobj is being called and if vec_pobj not an empty vector, the program crashes.
    I suppose that getVectorOfPObjects( any,vec_pobj) can't correctly allocate memory for vec_pobj elements in DEBUG mode.

  • Nested table variable intersect

    Hi everyone,
    I've created several nested tables of records, and I'd like to find the intersection of these variables. Just to use a a simple example:
    declare
      type test_record is record (
        col1 NUMBER,
        col2 VARCHAR2(255)
      type n_table is table of test_record;
      t1 n_table;
      t2 n_table;
      t3 n_table;
    begin
      t1(1).col1 := 1;
      t1(1).col2 := 'A';
      t1.extend;
      t1(2).col1 := 2;
      t1(2).col2 := 'B';
      t2(1).col1 := 1;
      t2(1).col2 := 'A';
      t2.extend;
      t2(2).col1 := 2;
      t2(2).col2 := 'B';
    end;Now what I'd like to do is find the intersection of tables t1 and t2, and store it in t3. I've read about using multiset operators, but those only seem to work on nested tables of scalar types, not records. Is there any way I could do this? If it helps, I am only considering one column in my intersection, so if I could somehow select col1 from t1 and col1 from t2, and find the intersection of that sub-set, that might work too.
    I'd also like to do it without looping through every row in every table, since the number of tables and number of rows can be quite large.
    Thanks!

    Hey Gerard, thanks for the reply.
    The collections only exist in memory, not in the database. I'm running the same raw data through a series of different functions, each of which returns a collection with some rows removed. My desired output is the set of rows which exist in every collection, so the intersection.
    I'm hesitant to change the type from a record to an object since the type is declared in a package and there's a lot of other procedures that use it. But you did get me thinking about using straight SQL. So I've made a table to use for temporary storage,
    CREATE TABLE TEMP_STORAGE  (
        col1 NUMBER,
        col2 VARCHAR2(255)
    )And now I can insert each collection into that table as they're made by the functions (with a normal for loop). Now when I want the intersection, I'm trying to write a query like:
    declare
      type test_record is record (
        col1 NUMBER,
        col2 VARCHAR2(255)
      type n_table is table of test_record;
      t3 n_table;
      total_collections NUMBER;
    begin
        total_collections := 4; --this number I won't know at design time, its a counter to see how many collections I've created and inserted into the temporary table
        select col1, col2 bulk collect into t3 from TEMP_STORAGE
            where count(col1) = total_collections;
    end;So I want to count the number of duplicates in col1 for a row, and if there are enough, then select that row. I know I can't use the count function like that, is there another way I can do this without creating a seperate table for each function, and doing an intersect on all of them?
    Thanks again for your quick response! If you need any clarification about what I'm doing or asking, please ask.

  • How internal tables are physicaly located in memory?

    Array, chained list, or else? Plese provide any opinion or documentation.
    Sincerely yours, Long Nguyen.

    A data model is an abstraction of a part of the real world which is represented using formal structures. A relational database basically uses one formal structure known as a table.
    A table can be defined as a two-dimensional matrix made of rows and columns. It can also be described as a group of records of the same type.Records are groups of fields based on existing data types. These data types are previously defined in the datadictionary. A table is a similar concept to a conventional indexed file; the difference is that in the relational model the main index is known as the primary key, which is made of one or more fields of the record. A record is also known as tuple or simply a row. The most significant feature of the primary key is that it identifies univocally one and only one record of the table: a table does not permit records with duplicated primary keys.
    Structures. The object structure refers to the definition of a compound object that does not have any content. It's like a table or a view, but it never has entries: it's only a structure. These types of objects are used in programs for defining data structures or for defining data in the interfaces from the module pools and the screens. The basic difference between structures and tables (or views) is that the
    structure does not exist at the underlying database system level; however, both tables and views do exist in the database. Structures only exist as definitions in the dictionary. As a result, structures do not need to be activated.
    Table. As previously explained, a table is a two-dimensional data matrix. A table can contain zero or many rows, corresponding to the predefined table structure (entity type). This is, at the same time, a complex structure, which can be made up of one or several fields (attributes). Every row that makes up the database table has the same structure and properties. The fields that make up the structure of the table records, as well as its attributes, permitted value range, and so on, are set when defining the table.
    Some general recommendations for internal tables:
    •     As long as all that you need from an internal table is to append lines to it and perhaps to sort it after filling it, standard tables are still the best choice. The other table kinds are too expen-sive for these simple tasks. Keep in mind that when inserting or deleting lines in index tables containing many lines, the administration of the logical index that manages the lines of the ta-ble internally can become expensive, with regard to performance and additional memory space. Only for standard tables that are filled with APPEND only, and where no lines are de-leted except for the last line, is there no need for a logical index, and hence
    no additional costs are incurred.
    •If memory space is an issue, for very large internal tables (> 500000 lines) with a
    small line size, sorted tables might be preferable to hashed tables, since for internal administration, they need only 6 bytes per line compared to 18 bytes for hashed tables.
    •When declaring internal tables, use the addition INITIAL SIZE only for inner tables in nested tables. For outer tables, the automatic allocation of initial memory size is appropriate. For inner tables, though, it may result in saving a large amount of memory.
    •When reading internal tables with READ TABLE or LOOP AT, choose the appropriate output behavior. Writing into a work area wa with the addition INTO wa is only necessary if you want to change the work area without influencing the internal table. For pure reading purposes or for modifying the contents of the internal table, the additions ASSIGNING <fs> for assigning internal table lines to a field symbol <fs> and REFERENCE INTO dref for setting a refer-ence in a data reference variable dref to internal table lines are the better choices by far.
    •Use CLEAR instead of REFRESH for internal tables. The reason is that for internal tables with-out header lines, the general statement CLEAR does exactly the same as the special state-ment REFRESH. Since internal tables with header lines should no longer be used, the state-ment REFRESH is effectively obsolete. In order to free more memory, you can consider the use of FREE.
    •The statement COLLECT should no longer be used for standard tables — use COLLECT mainly for hashed tables. The reason is that COLLECT is based on a hash algorithm. While the hash administration of a hashed table is always available and robust, for standard tables a temporary hash administration must be created when the COLLECT statement is used. This temporary hash administration is invalidated when the table is accessed for changing. If fur-ther COLLECT statements are entered after an invalidation, a linear search of all table rows must be performed. Furthermore, COLLECT only works properly on internal tables with unique lines, while a unique table key is guaranteed for hashed tables only. Therefore, for standard tables it cannot be guaranteed that the contents will always be suitable for editing using COLLECT.
    •Don’t use APPEND SORTED BY — use SORT instead. The reason is that creating a ranked list with APPEND SORTED BY is based on several assumptions about the internal table and how it is filled. Using SORT is the general method that can be applied to all kinds of table and inde-pendent from the mode of filling.
    Chk these links for more information about internal tables
    internal tables
    Regards,
    Balaji Reddy G
    **Rewards for helpful answers

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

  • Huge memory leaks in using PL/SQL tables and collections

    I have faced a very interesting problem recently.
    I use PL/SQL tables ( Type TTab is table of ... index by binary_integer; ) and collections ( Type TTab is table of ...; ) in my packages very widely. And have noticed avery strange thing Oracle does. It seems to me that there are memory leaks in PGA when I use PL/SQL tables or collections. Let me a little example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TNumberList IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    PROCEDURE test_plsql_table(cnt INTEGER);
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    END;
    END rds_mdt_test;
    I run the following test code:
    BEGIN
    rds_mdt_test.test_plsql_table (1000000);
    END;
    and see that my session uses about 40M in PGA.
    If I repeat this example in the same session creating the PL/SQL table of smaller size, for instance:
    BEGIN
    rds_mdt_test.test_plsql_table (1);
    END;
    I see again that the size of used memory in PGA by my session was not decreased and still be the same.
    The same result I get if I use not PL/SQL tables, but collections or varrays.
    I have tried some techniques to make Oracle to free the memory, for instance to rewrite my procedure in the following ways:
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x.DELETE;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    FOR indx in 1 .. cnt LOOP
    x.DELETE(indx);
    END LOOP;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    empty TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x := empty;
    END;
    and so on, but result was the same.
    This is a huge problem for me as I have to manipulate collections and PL/SQL tables of very big size (from dozens of thousand of rows to millions or rows) and just a few sessions running my procedure may cause server's fall due to memory lack.
    I can not understand what Oracle reseveres such much memory for (I use local variables) -- is it a bug or a feature?
    I will be appreciated for any help.
    I use Oracle9.2.0.1.0 server under Windows2000.
    Thank you in advance.
    Dmitriy.

    Thank you, William!
    Your advice about using DBMS_SESSION.FREE_UNUSED_USER_MEMORY was very useful. Indeed it is the tool I was looking for.
    Now I write my code like this
    declare
    type TTab is table of ... index binary_integer;
    res TTab;
    empty_tab TTab;
    begin
    res(1) := ...;
    res := empty_tab;
    DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
    end;
    I use construction "res := empty_tab;" to mark all memory allocated to PL/SQL table as unused according to Tom Kyte's advices. And I could live a hapy life if everything were so easy. Unfortunately, some tests I have done showed that there are some troubles in cleaning complex nested PL/SQL tables indexed by VARCHAR2 which I use in my current project.
    Let me another example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    TYPE TRec1 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab0);
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY BINARY_INTEGER;
    TYPE TRec2 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab1);
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY BINARY_INTEGER;
    TYPE TStrTab IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    PROCEDURE test_plsql_table(cnt INTEGER);
    PROCEDURE test_str_tab(cnt INTEGER);
    x TTab2;
    empty_tab2 TTab2;
    empty_tab1 TTab1;
    empty_tab0 TTab0;
    str_tab TStrTab;
    empty_str_tab TStrTab;
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    BEGIN
    FOR indx1 IN 1 .. cnt LOOP
    FOR indx2 IN 1 .. cnt LOOP
    FOR indx3 IN 1 .. cnt LOOP
    x(indx1) .rows(indx2) .rows(indx3) := indx1;
    END LOOP;
    END LOOP;
    END LOOP;
    x := empty_tab2;
    dbms_session.free_unused_user_memory;
    END;
    PROCEDURE test_str_tab(cnt INTEGER) IS
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    str_tab(indx) := indx;
    END LOOP;
    str_tab := empty_str_tab;
    dbms_session.free_unused_user_memory;
    END;
    END rds_mdt_test;
    1. Running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that usage of PGA memory in my session is close to zero. So, I can judge that nested PL/SQL table indexed by BINARY_INTEGER and the memory allocated to it were cleaned successfully.
    2. Running the script
    BEGIN
    rds_mdt_test.test_str_tab ( 1000000 );
    END;
    I can see that plain PL/SQL table indexed by VARCHAR2 and memory allocated to it were cleaned also.
    3. Changing the package's type
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY VARCHAR2(256);
    and running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that my session uses about 62M in PGA. If I run this script twice, the memory usage is doubled and so on.
    The same result I get if I rewrite not highest, but middle PL/SQL type:
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY VARCHAR2(256);
    And only if I change the third, most nested type:
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    I get the desired result -- all memory was returned to OS.
    So, as far as I can judge, in some cases Oracle does not clean complex PL/SQL tables indexed by VARCHAR2.
    Is it true or not? Perhaps there are some features in using such way indexed tables?

  • How to return a OCI Table * (nested table) from OCI application to sqlplus

    Hi,
    How to return a OCI Table * (nested table) from OCI application to sqlplus prompt : OCITAble * shows up as empty on the SQLPLUS prompt.
    The ODCIAggregateTerminate member function's OUT parameter is OCITable * returnValue. After completion of this member function it displays data on the sqlplus prompt.
    My problem is that eventhough my OCITable(returnvalue) has elements appended or added to it. But when I return the OCITAble after completion
    of this member function the OCITable shows up as empty collection on the SQLPLUS prompt. But in the OCI code if I iterate through the collection
    I can print out the elements and see their values or data.
    Can any one let me know how I can make the elements or data in the collection available at SQLPLUS prompt after the completion of this member function.
    If my return value or OUT parameter of this member function is OCINumber * returnValue : then I can see the corresponding value assigned in the OCI Code
    and the same value is returned and visible on the SQLPLUS prompt. But when I use the OUT parameter as OCITAble * : then it shows up as empty collection.
    I don't really know why is it happening so.
    member function ODCIAggregateTerminate(
    self IN OUT MinDistanceImpl, returnValue OUT table_out1,
    flags IN number)
    return number
    as language C
    library custagg name "ODCIAggregateTerminate"
    with context
    parameters (
    context,
    self,
    self INDICATOR STRUCT,
    returnValue ,
    returnValue INDICATOR,
    flags,
    flags INDICATOR ,
    RETURN ),
    typedef OCITable table_out1;
    struct ntab_type
    OCINumber empno;
    OCINumber salary;
    OCIString * tst;
    OCIString * te;
    typedef struct ntab_type ntab_type;
    struct ntab_type_ind
    OCIInd _atomic;
    OCIInd empno;
    OCIInd salary;
    OCIInd tst;
    OCIInd te;
    typedef struct ntab_type_ind ntab_type_ind;
    extern "C" OCINumber * ODCIAggregateTerminate(
    OCIExtProcContext *context,
    MinDistanceImpl * self,
    MinDistanceImpl_ind * self_ind,
    table_out1 * returnValue,
    short * returnValue_ind,
    OCINumber * flags,
    short flags_ind)
    ocitypename for collection..
    ocitypename for element
    ociobjectnew for collection
    ociobjectNew's for elements
    ocicollappend of elements to collection
    then iterate thru collection
    and at them collection as those elements and we return that collection
    But is empty : on SQLPLUS prompt :
    Select Mindis(TT) from table1;
    TT(empno, salary, tstart, te)
    Table_Out1()

    > Can anyone pls let me know if there is some way to return an entire table from a function which
    is called from a stored procedure?
    For what purpose?
    Do you realise that this means pulling Megabytes (or even many Gugabytes) of data from disk, into the buffer cache, and then copying that data into PL/SQL memory (using a function) in order to give a stored proc that data?
    This is just plain crazy.. resource wise, performance wise, scalability wise.. this is exactly how NOT to use Oracle.
    Why don't you instead tell us what problem you want to solve. Forget for the moment what you think the solution should be. (and asking us how to get a potentially flawed solution, to work)
    Let's get an accurate problem definition so that we can provide you with suggestions and recommendation on what Oracle features can be used to address that problem.

  • Load nested XML into table

    Hello, could anyone help me on this? I have a XML file as below:
    <Feed>
    <svc>enr1</svc>
    <report_email>[email protected]</report_email>
    <requisition id="12">
    <email>[email protected]</email>
    <Name>Joseph</Name>
    <PRODUCT>
         <PROD_ID>532343234</PROD_ID>
         <NAME>KID'S WEAR </NAME>
         <DATE_ORDERED>09/04/2009</DATE_ORDERED>
    </PRODUCT>
    <PRODUCT>
         <PROD_ID>67045434</PROD_ID>
         <NAME>SHOES</NAME>
         <DATE_ORDERED>09/04/2009</DATE_ORDERED>
    </PRODUCT>
    </requisition>
    <requisition id="13">
    <email>[email protected]</email>
    <Name>Sarah</Name>
    <PRODUCT>
         <PROD_ID>11111111</PROD_ID>
         <NAME>LOST IN FOREST</NAME>
         <DATE_ORDERED>10/05/2008</DATE_ORDERED>
    </PRODUCT>
    <PRODUCT>
         <PROD_ID>222222222</PROD_ID>
         <NAME>TRY IT NOW</NAME>
         <DATE_ORDERED>09/04/2007</DATE_ORDERED>
    </PRODUCT>
    </requisition>
    </Feed>

    You could flatten the XML into table style output using XMLTABLE...
    WITH t as (select XMLTYPE('
    <RECSET>
      <REC>
        <COUNTRY>1</COUNTRY>
        <POINT>1800</POINT>
        <USER_INFO>
          <USER_ID>1</USER_ID>
          <TARGET>28</TARGET>
          <STATE>6</STATE>
          <TASK>12</TASK>
        </USER_INFO>
        <USER_INFO>
          <USER_ID>5</USER_ID>
          <TARGET>19</TARGET>
          <STATE>1</STATE>
          <TASK>90</TASK>
        </USER_INFO>
      </REC>
      <REC>
        <COUNTRY>2</COUNTRY>
        <POINT>2400</POINT>
        <USER_INFO>
          <USER_ID>3</USER_ID>
          <TARGET>14</TARGET>
          <STATE>7</STATE>
          <TASK>5</TASK>
        </USER_INFO>
      </REC>
    </RECSET>') as xml from dual)
    -- END OF TEST DATA
    select x.country, x.point, y.user_id, y.target, y.state, y.task
    from t
        ,XMLTABLE('/RECSET/REC'
                  PASSING t.xml
                  COLUMNS country NUMBER PATH '/REC/COUNTRY'
                         ,point   NUMBER PATH '/REC/POINT'
                         ,user_info XMLTYPE PATH '/REC/*'
                 ) x
        ,XMLTABLE('/USER_INFO'
                  PASSING x.user_info
                  COLUMNS user_id NUMBER PATH '/USER_INFO/USER_ID'
                         ,target  NUMBER PATH '/USER_INFO/TARGET'
                         ,state   NUMBER PATH '/USER_INFO/STATE'
                         ,task    NUMBER PATH '/USER_INFO/TASK'
                 ) y
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5Or you could shread the XML into Oracle nested tables...
    e.g.
    (Based on response from mdrake on this thread: Re: XML file processing into oracle
    Reading XML using a schema...
    declare
      SCHEMAURL VARCHAR2(256) := 'http://xmlns.example.org/xsd/testcase.xsd';
      XMLSCHEMA VARCHAR2(4000) := '<?xml version="1.0" encoding="UTF-8"?>
         <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
            <xs:element name="cust_order" type="cust_orderType" xdb:defaultTable="CUST_ORDER_TBL"/>
            <xs:complexType name="groupType" xdb:maintainDOM="false">
                    <xs:sequence>
                            <xs:element name="item" type="itemType" maxOccurs="unbounded"/>
                    </xs:sequence>
                    <xs:attribute name="id" type="xs:byte" use="required"/>
            </xs:complexType>
            <xs:complexType name="itemType" xdb:maintainDOM="false">
                    <xs:simpleContent>
                            <xs:extension base="xs:string">
                                    <xs:attribute name="id" type="xs:short" use="required"/>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                            </xs:extension>
                    </xs:simpleContent>
            </xs:complexType>
            <xs:complexType name="cust_orderType" xdb:maintainDOM="false">
                    <xs:sequence>
                            <xs:element name="group" type="groupType" maxOccurs="unbounded"/>
                    </xs:sequence>
                    <xs:attribute name="cust_id" type="xs:short" use="required"/>
            </xs:complexType>
         </xs:schema>';
      INSTANCE  CLOB :=
    '<cust_order cust_id="12345">
      <group id="1">
        <item id="1" name="Standard Mouse">100</item>
        <item id="2" name="Keyboard">100</item>
        <item id="3" name="Memory Module 2Gb">200</item>
        <item id="4" name="Processor 3Ghz">25</item>
        <item id="5" name="Processor 2.4Ghz">75</item>
      </group>
      <group id="2">
        <item id="1" name="Graphics Tablet">15</item>
        <item id="2" name="Keyboard">15</item>
        <item id="3" name="Memory Module 4Gb">15</item>
        <item id="4" name="Processor Quad Core 2.8Ghz">15</item>
      </group>
      <group id="3">
        <item id="1" name="Optical Mouse">5</item>
        <item id="2" name="Ergo Keyboard">5</item>
        <item id="3" name="Memory Module 2Gb">10</item>
        <item id="4" name="Processor Dual Core 2.4Ghz">5</item>
        <item id="5" name="Dual Output Graphics Card">5</item>
        <item id="6" name="28inch LED Monitor">10</item>
        <item id="7" name="Webcam">5</item>
        <item id="8" name="A3 1200dpi Laser Printer">2</item>
      </group>
    </cust_order>';                
    begin
      dbms_xmlschema.registerSchema
         schemaurl       => SCHEMAURL
        ,schemadoc       => XMLSCHEMA
        ,local           => TRUE
        ,genTypes        => TRUE
        ,genBean         => FALSE
        ,genTables       => TRUE
        ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
      execute immediate 'insert into CUST_ORDER_TBL values (XMLTYPE(:INSTANCE))' using INSTANCE;
    end;
    desc CUST_ORDER_TBL
    SQL> desc CUST_ORDER_TBL
    Name                                                                                                                                    Null?    Type
    TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.org/xsd/testcase.xsd" Element "cust_order") STORAGE Object-relational TYPE "cust_orderType222_T"
    set autotrace on explain
    set pages 60 lines 164 heading on
    col cust_id format a8
    select extract(object_value,'/cust_order/@cust_id') as cust_id
          ,grp.id as group_id, itm.id as item_id, itm.inm as item_name, itm.qty as item_qty
    from   CUST_ORDER_TBL
          ,XMLTABLE('/cust_order/group'
                    passing object_value
                    columns id   number       path '@id'
                           ,item xmltype      path 'item'
                   ) grp
          ,XMLTABLE('/item'
                    passing grp.item
                    columns id   number       path '@id'
                           ,inm  varchar2(30) path '@name'
                           ,qty  number       path '.'
                   ) itm
    CUST_ID    GROUP_ID    ITEM_ID ITEM_NAME                        ITEM_QTY
    12345             1          1 Standard Mouse                        100
    12345             1          2 Keyboard                              100
    12345             1          3 Memory Module 2Gb                     200
    12345             1          4 Processor 3Ghz                         25
    12345             1          5 Processor 2.4Ghz                       75
    12345             2          1 Graphics Tablet                        15
    12345             2          2 Keyboard                               15
    12345             2          3 Memory Module 4Gb                      15
    12345             2          4 Processor Quad Core 2.8Ghz             15
    12345             3          1 Optical Mouse                           5
    12345             3          2 Ergo Keyboard                           5
    12345             3          3 Memory Module 2Gb                      10
    12345             3          4 Processor Dual Core 2.4Ghz              5
    12345             3          5 Dual Output Graphics Card               5
    12345             3          6 28inch LED Monitor                     10
    12345             3          7 Webcam                                  5
    12345             3          8 A3 1200dpi Laser Printer                2
    17 rows selected.Need at least 10.2.0.3 for performance i.e. to avoid COLLECTION ITERATOR PICKLER FETCH in execution plan...
    On 10.2.0.1:
    Execution Plan
    Plan hash value: 3741473841
    | Id  | Operation                          | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                   |                        | 24504 |    89M|   873   (1)| 00:00:11 |
    |   1 |  NESTED LOOPS                      |                        | 24504 |    89M|   873   (1)| 00:00:11 |
    |   2 |   NESTED LOOPS                     |                        |     3 | 11460 |   805   (1)| 00:00:10 |
    |   3 |    TABLE ACCESS FULL               | CUST_ORDER_TBL         |     1 |  3777 |     3   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN                | SYS_IOT_TOP_774117     |     3 |   129 |     1   (0)| 00:00:01 |
    |   5 |   COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE |       |       |            |       |
    Predicate Information (identified by operation id):
       4 - access("NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
           filter("SYS_NC_TYPEID$" IS NOT NULL)
    Note
       - dynamic sampling used for this statementOn 10.2.0.3:
    Execution Plan
    Plan hash value: 1048233240
    | Id  | Operation               | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT        |                   |    17 |   132K|   839   (0)| 00:00:11 |
    |   1 |  NESTED LOOPS           |                   |    17 |   132K|   839   (0)| 00:00:11 |
    |   2 |   MERGE JOIN CARTESIAN  |                   |    17 |   131K|   805   (0)| 00:00:10 |
    |   3 |    TABLE ACCESS FULL    | CUST_ORDER_TBL    |     1 |  3781 |     3   (0)| 00:00:01 |
    |   4 |    BUFFER SORT          |                   |    17 | 70839 |   802   (0)| 00:00:10 |
    |*  5 |     INDEX FAST FULL SCAN| SYS_IOT_TOP_56154 |    17 | 70839 |   802   (0)| 00:00:10 |
    |*  6 |   INDEX UNIQUE SCAN     | SYS_IOT_TOP_56152 |     1 |    43 |     2   (0)| 00:00:01 |
    |*  7 |    INDEX RANGE SCAN     | SYS_C006701       |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       5 - filter("SYS_NC_TYPEID$" IS NOT NULL)
       6 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
                  w5Ysl6x9w=="."SYS_NC0000600007$")
           filter("SYS_NC_TYPEID$" IS NOT NULL AND
                  "NESTED_TABLE_ID"="CUST_ORDER_TBL"."SYS_NC0000900010$")
       7 - access("SYS_NTpzENS1H/RwSSC7TVzvlqmQ=="."NESTED_TABLE_ID"="SYS_NTnN5b8Q+8Txi9V
                  w5Ysl6x9w=="."SYS_NC0000600007$")
    Note
       - dynamic sampling used for this statementCLEAN UP...
    DROP TABLE CUST_ORDER_TBL purge;
    exec dbms_xmlschema.deleteschema('http://xmlns.example.org/xsd/testcase.xsd');

Maybe you are looking for

  • Pf-status for alv report

    experts, 1)   how to set pf-status when using 'REUSE_ALV_GRID_DISPLAY' 2) i have used a is_layout- box_fieldname to display a column     as  buttons (selection). can we select multiple rows using the buttons without using ctrl or shift keys.

  • Can not open flex application in IE

    Dears,    I met a problem as below. I login a pc client which restricted to access D drive (no read permission) and can not access internet as well. But, it is able to access the intranet servers. However, I found that I can not open the flex applica

  • Can't get alarm to work on new ipod--never had trouble with old ipod

    Greetings all, I just got a new Classic 120GB and it is great but I can't get the alarm clock to work...when I set a time for the alarm clock, it doesn't seem to remember this time but it instead defaults to an hour later than the current actual time

  • How do I get the file name?

    I'm kind of new to javascript -- working with a colleague who has Adobe Acrobat Professional -- I've got an *old* version of Adobe Acrobat and most of the functions don't work -- but how do we get the file name -- we're trying to develop an applicati

  • Can I terminate automatic cursor location in Purchase Order ?

    Hi, expert. I have an issue about purchase order. When I fill the vender, purchase group, material, POquantity and plant and press enter in transaction cord ME21N, the cursor is automatically transferred to the "delivery date" and a message "Can deli