When to use nested Tables vs Varrays

Nested tables

When data must be stored in a database table
When the size of the data cannot be predefined i.e. the collection / data container must be dynamic
When the dml operations should be made on individual items in the column.


VARRAY
When the number of elements are predefined
When data must be stored in the database

But when it comes to performance

Please can anyone suggest some example scenario in which case it is best to use one of them and why.

Thank you.

Here is a link that you should try:

http://www.williamrobertson.NET/reframe.HTML?documents/collection-types.html

Tags: Database

Similar Questions

  • ORA-22907: invalid CAST to a type that is not a nested table or VARRAY. Typed collection function

    Hello

    I tried to create a function that might return the type that is created on the outside.

    So I wrote script below. until the function created it compiled successfully, but after that, when the data querying, we encountered error,

    "ORA-22907: invalid CAST to a type that is not a nested table or VARRAY.

    SQL> create table emp
      2  (
      3    ename        varchar2(200 byte),
      4    mgr          number,
      5    employee_id  number
      6  );
    
    
    Table created.
    
    
    SQL> insert into emp (ename, mgr, employee_id)
      2       values ('king', 12, 1);
    
    
    1 row created.
    
    
    SQL> insert into emp (ename, mgr, employee_id)
      2       values ('clark', 12, 2);
    
    
    1 row created.
    
    
    SQL> commit;
    
    
    Commit complete.
    
    
    SQL> create or replace type t_emp as object (ename varchar2 (200), mgr number, employee_id number);
      2  /
    
    
    Type created.
    
    
    SQL> create or replace function f_emp return  t_emp
      2   is
      3  type rc_emp is ref cursor;
      4  r_emp rc_emp;
      5  v_emp t_emp;
      6  begin
      7   open r_emp for select * from emp where rownum=1;
      8   fetch r_emp into v_emp;
      9  close r_emp;
     10  return v_emp;
     11  exception
     12      when others then
     13      dbms_output.put_line(dbms_utility.format_error_stack);
     14      dbms_output.put_line(dbms_utility.format_call_stack);
     15      dbms_output.put_line(dbms_utility.format_error_backtrace);
     16      raise_application_error(-20001,sqlerrm);
     17  end;
     18  /
    
    
    Function created.
    
    
    SQL> show errors;
    No errors.
    SQL> select * from f_emp;
    select * from f_emp
                  *
    ERROR at line 1:
    ORA-04044: procedure, function, package, or type is not allowed here
    
    
    
    
    SQL> select * from table(cast (f_emp as t_emp));
    select * from table(cast (f_emp as t_emp))
                              *
    ERROR at line 1:
    ORA-22907: invalid CAST to a type that is not a nested table or VARRAY
    
    
    
    
    SQL>
    

    Like this:

    ...

    CREATE or REPLACE TYPE t_emp_array IS TABLE OF THE t_emp;

    /

    FUNCTION to CREATE or REPLACE f_emp RETURN t_emp_array

    is

    type rc_emp is ref cursor;

    r_emp rc_emp;

    v_emp_array t_emp_array: = t_emp_array();

    BEGIN

    R_emp OPEN for SELECT t_emp(ename,mgr,employee_id) FROM emp WHERE ROWNUM = 1;

    collect the fetch r_emp in bulk in v_emp_array;

    CLOSE R_emp;

    Return v_emp_array;

    exception

    while others then

    dbms_output.put_line (dbms_utility.format_error_stack);

    dbms_output.put_line (dbms_utility.format_call_stack);

    dbms_output.put_line (dbms_utility.format_error_backtrace);

    raise_application_error (-20001, SQLERRM);

    end;

    /

    SELECT *.

    table (f_emp ());

    a table function works with a table (nested table or varray)

    HTH

  • Why the hell use nested tables?

    Hello
    I'm boning up on top of the PL/SQL (again) waiting to get a new job.
    I have several years of experience in various roles related to the data, including many used Oracle.
    On the issue of collections, I ask myself, in light of my experience, to find and not for the first time, why the hell would anyone want to do this:

    create or replace type TEST_TT as table of varchar2(10);
    /
    
    create table TEST_TABLE ( X number
                             ,Y test_tt) 
                             nested table Y store as Y_TABLE;                      
    I really, really, can't think why we want to store data like that. It seems unnecessarily complex, hiding a one-to-many relationship inside TEST_TABLE, which should rather be modeled and implemented as a separate table.
    In addition, there are a lot of tutorials on the collections that tell us how to do the above (in fact I read Feuerstein right now), but nobody seems to tell us WHY we should do it.

    Can someone help me out here?

    Thank you.
    Jason

    I can't imagine wanting to create a table like this one either (or, if this can help, can Tom Kyte).

    The collections are terribly useful in PL/SQL, when they help you avoid one treatment per line. I can't imagine wanting to integrate into my data model. Frankly, it's much the same with the types of objects - they are quite useful in PL/SQL, but I would never want to create a table in my data model that contained an object.

    Justin

  • Can you attribute programmatically size when you use the table in the Cluster service cluster

    I use the table of the Cluster service.  The only way I know to the size of the cluster is to right click on the function and set the Cluster size.  But what happens if the length of my table changes?  Is there a way to make the cluster size is the number of elements in the table?  Seems like labview should do this automatically at run time.  There may be some nodes of property I don't know.

    I tried the SQL statements, but it always boils down to having to know the number of columns is in the database prior to execution.

    What I did to generate the object to be a cluster to match database fields.  My recordset is an array of objects.  Then I a vi member to build a recordset from the database and another Member vi to retrieve an array of clusters of the recordset object.  If the database changes, I have to change the subject and these two vi.  All the other Subvi call these two for the manipulation of data.  No other sub - VI have bundle and ungroup functions in them, only the vi of two members.  Thus a change in the database requires a change of control and two vi.  Not too bad.

    (I'm tooting my Horn in choosing me as accetped solution provider.  I learned this bad habit of others here on the forum.  )

  • How do I get the number of incorrect records when you use external tables

    Hi all, I have an external table DEPT,.

    DEPT. DAT

    20. ELECTRONICS

    10. SHOES

    30. CAMERA

    Select * from the Department; only 10 and 30 dept will be led as deptdescr for 20 that there are more than 10 in length so this record will go into the wrong file,

    y at - it count any query to display the folder or get any query to get the record to view the entries entries wrong file rather that will drop and see how much is rejected.

    Table:

    CREATE TABLE DEPT
    (
       DEPT        NUMBER,
       DEPTDESCR   VARCHAR2 (10 CHAR)
       )           ORGANIZATION EXTERNAL
      (  TYPE ORACLE_LOADER
         DEFAULT DIRECTORY BATCH_INBOX
         ACCESS PARAMETERS
           ( RECORDS DELIMITED  BY '\r\n'
                  BADFILE  BATCH_BAD:'UPS_DEPT_LOAD_%p.bad'
                  LOGFILE  BATCH_LOG:'UPS_DEPT_%p.log'
                  NODISCARDFILE
        FIELDS  TERMINATED BY '|'
        MISSING FIELD VALUES ARE NULL
    (
    DEPT,
    DEPTDESCR
    )
                                    )
         LOCATION (BATCH_INBOX:'DEPT.DAT')
      )
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;
    

    You can use the wrong file as the data file for another external table, with the entire line in a single field.  Please see the demo below.

    Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_inbox AS 'c:\my_oracle_files '.

    2.

    Created directory.

    Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_bad AS 'c:\my_oracle_files '.

    2.

    Created directory.

    Scott@orcl12c > CREATE or REPLACE DIRECTORY batch_log AS 'c:\my_oracle_files '.

    2.

    Created directory.

    Scott@orcl12c > CREATE TABLE DEPT

    2       (

    NUMBER 3 DEPT,

    4 DEPTDESCR VARCHAR2 (10 CHAR)

    (5) ORGANIZATION EXTERNAL

    6 (TYPE ORACLE_LOADER

    7 DEFAULT DIRECTORY BATCH_INBOX

    8 ACCESS SETTINGS

    9 (RECORDS DELIMITED BY "\r\n"

    10 BADFILE BATCH_BAD: 'UPS_DEPT_LOAD.bad'

    11 BATCH_LOG:'UPS_DEPT_%p.log LOGFILE'

    12 NODISCARDFILE

    13 FIELDS TERMINATED BY ' |'

    14 MISSING FIELD VALUES ARE NULL

    15       (

    DEPT 16,

    17 DEPTDESCR

    18       )

    19                       )

    LOCATION 20 (BATCH_INBOX:'DEPT.) DAT')

    21         )

    RELEASE 22 UNLIMITED LIMIT

    23 NOPARALLEL

    24 NOMONITORING;

    Table created.

    Scott@orcl12c > SELECT * FROM dept

    2.

    DEPTDESCR DEPT

    ---------- ----------

    10 SHOES

    CAMERA 30

    2 selected lines.

    Scott@orcl12c > CREATE TABLE DEPT_bad

    2       (

    3 the_whole_row VARCHAR2 (4000)

    (4) ORGANIZATION EXTERNAL

    5 (TYPE ORACLE_LOADER

    6 DEFAULT DIRECTORY BATCH_INBOX

    7 ACCESS SETTINGS

    8 (RECORDS DELIMITED BY "\r\n"

    9 NOLOGFILE

    10 FIELDS TERMINATED BY '\r\n '.

    11. THE MISSING FIELD VALUES ARE NULL

    12       (

    13 the_whole_row CHAR (4000)

    14       )

    15                       )

    16 RENTAL (BATCH_BAD:'UPS_DEPT_LOAD.) THE BAD ")"

    17         )

    RELEASE 18 UNLIMITED LIMIT

    19 NOPARALLEL

    20 NOMONITORING

    21.

    Table created.

    Scott@orcl12c > SELECT * FROM dept_bad

    2.

    THE_WHOLE_ROW

    --------------------------------------------------------------------------------

    20. ELECTRONICS

    1 selected line.

  • When you use the table of contents

    A few questions

    Can I do the button contents of larger.  Currently, the arrows are not useful to the partially overview

    I can move the TOC button to another location. say at the bottom of the page

    Is it possible to put a button until you see the table of contents

    Is it going to rain tomorrow

    What makes my wife tea tonight

    Hello Devon,

    However, I know that's not possible. The button table of contents is generated only generated at run time and has not yet been exposed to the Skin Editor TOC UI. If like me you want to it see the ability to customize it in a future version of Captivate so please add your voice by presenting this as a feature request.

    Adobe Captivate feature request/Bug Report Form

    Best - Mark

    Visit blog macrofireball

  • Nested tables will not align with the primary table


    Hi all. Looks like I am facing another obstacle focus on the table. While I was creating one of my pages, I used nested tables to create a column on the left side of the page that will contain my menu secondary, while the other column will hold a flash element and the content of the page.

    Although I have inserted tables nested with a spacing of the cell '0' and '0' cell padding and Visual AIDS seem to indicate that the values in the nested table are identical with the primary table who is the holder, the nested table that will contain the film and the page content is not embedded with the table above. It seems to be off by 1-2 pixels or more, but since there will be a right on the image under the menu is quite obvious.

    I enclose the code for your information (line 165, 166).

    Thank you for your time and your suggestions. I really appreciate it.

    Saturday, September 16, 2006 15:06:50 + 0000 (UTC), "HTML-Newbie.
    wrote:

    > Discover the link http://www.fastventures.com/dev/test_temp_2col.html and you
    > see the picture under the main menu align with her on the
    > right side.

    Change this:




    To do this:

    <>
    SRC = "img/place_second.jpg" width = "572" height = "200" > "

    align = "right" >

    <>
    SRC = "img/place_second.jpg" width = "572" height = "200" > "

    Gary

  • nested table disappears in design mode

    Hello

    Sometimes, when I have nested tables, the intimate table disappears in Design view. The table looks fine in a browser, however. Anyone know what is happening?
    Thank you!

    The technical term is that the syntax of table is horked.

    After detached the model, there are tons of tags highlighted in yellow
    in the code.

    --
    Alan
    Adobe Community Expert, dreamweaver

    http://www.Adobe.com/communities/experts/

  • How can you add item (object) complex "nested table"?

    Hello I did some reading on * "Associative" * and * "Nested Table" * and I would like to enumerate the collection using the later version (http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Tables/2/)
    -know list "Nested Table"

    However, encountered problem try to * 'EXTEND' * my nested table (add items to the complex type or OBJECT I defined, namely 'TmpHierarchyMapObjType' below) - detail as follows:

    -NOTE 1: Here's how to create the type object (be well if I just say "CREATE or REPLACE TYPE TmpHierarchyMapObjType AS OBJECT (_TMP_HIERACHICAL. ROWTYPE_)"instead of having to duplicate the column definition.
    CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT
    (
    ID numeric (19.0),.
    ParentId numeric (19.0),.
    ChildId numeric (19.0),.
    ...
    TmpUID varchar2 (32),
    ReferencedId numeric (19.0),.
    ...
    );

    -NOTE 2: I can't put 'TmpHierarchyMapObjType' inside the package, but it's not crucial, I guess.
    Types of CREATE or REPLACE PACKAGE
    AS
    TYPE cursorType IS REF CURSOR;
    TYPE TmpHiearchyMapTableType IS TABLE OF THE TmpHierarchyMapObjType; / * Use 'Nested Table' instead of an associative array * /.
    / * TYPE TmpHiearchyMapTableType IS TABLE OF THE TMP_HIERARCHYMAP % ROWTYPE INDEX DIRECTORY. */
    END;

    -NOTE 3: Here is my FUNCTION TABLE that now returns a "Nested Table" as assumed to 'Associative' (with a syntax different enumeration)
    FUNCTION to CREATE or REPLACE spGetParentsTable
    (
    Number to the ObjectId,
    ObjectClassifier varchar2
    )
    RETURN types . TmpHiearchyMapTableType -now a 'Nested Table', not 'voluntary '.
    IS
    Types of TmpHierarchyMap. TmpHiearchyMapTableType;
    ThisTempId varchar2 (32);
    CURSOR spGetParents_cursor IS
    SELECT
    ReferencedId Id,
    ParentId,
    ChildId,
    ...
    OF TMP_HIERARCHYMAP
    WHERE TmpUID = ThisTempId;
    BEGIN
    SELECT sys_guid() IN the double ThisTempId;

    spRecursiveGetParents (ObjectId, ObjectClassifier, ThisTempId);

    -(Commentary) TmpHierarchyMapMAX: = 0;
    FOR oMap in spGetParents_cursor LOOP
    -(Commented out) TmpHierarchyMapMAX: = TmpHierarchyMapMAX + 1;

    -QUESTION: FAILED here! How can I add/elements of complex types?
    TmpHierarchyMap.EXTEND (cast (oMap as TmpHierarchyMapObjType));

    /*
    NOTE: (In the comment) use is not "Associative", now using "nested table" instead.
    TmpHierarchyMap (TmpHierarchyMapMAX). ID: = oMap.Id;
    TmpHierarchyMap (TmpHierarchyMapMAX). ParentId: = oMap.ParentId;
    TmpHierarchyMap (TmpHierarchyMapMAX). ChildId: = oMap.ChildId;
    ...
    */
    END LOOP;

    DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;

    RETURN TmpHierarchyMap;

    END spGetParentsTable;

    -Finally, I would like to enumerate the nested table.
    DECLARE
    types of oMappingTable. TmpHiearchyMapTableType;
    BEGIN

    oMappingTable: = spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');

    -NOTE 4: this is my final goal!
    Select * from table (cast (oMappingtable as types.) TmpHiearchyMapTableType));

    dbms_output.put_line ('done!');
    END;


    REF:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/Collections.htm#LNPLS005
    http://www.DevShed.com/c/a/Oracle/associative-arrays-in-Oracle-PLSQL-introduction/2/
    http://www.DevShed.com/c/a/Oracle/database-interaction-with-PLSQL-nested-tables/2/

    Hello

    Try this,

    TmpHierarchyMap.Extend();
    TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
                                                                    , oMap.ParentId
                                                                    , ... );
    

    Kind regards

    Christian Balz

  • SQL with the Table using nested

    Hello

    Please help how to do that thing

    I have a nested table of object type

    create or replace type a1 as an object

    (

    a number,

    b varchar2 (30),

    VARCHAR2 (30) region

    );

    create table a1 type a1_array s;

    declare

    v_a1 a1;

    v_a1_array a1_array:=a1_array();

    Start

    v_a1 = a1 (1, '1', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (1): = v_a1;

    v_a1 = a1 (2, '2', 'AUS');

    v_a1_array. EXTEND;

    v_a1_array (2): = v_a1;

    v_a1 = a1 (3, '3', 'NAM');

    v_a1_array. EXTEND;

    v_a1_array (3): = v_a1;

    end;

    Now, I v_a1_array have 3 row 2 with region AUS and the other with NAM region.

    SQL help can I get lines only "AUS" and look in the TABLE OF TYPE v_a1_array (using Where clause and functions (Table))

    Any help will be much appreciated. Please help. I have Oracle 11g

    Thank you

    I hope that you are looking for this.

    pretend like your excel temp (with clause)

    v_a2 - is a type of a1_array

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE Production 11.2.0.2.0
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    SQL > DROP TYPE a1_array;

    Type fell.

    SQL > DROP TYPE a1;

    Type fell.

    SQL > CREATE or REPLACE TYPE a1 AS OBJECT
    2 (a NUMBER, b VARCHAR2 (30), region VARCHAR2 (30));
    3.

    Type of creation.

    SQL > CREATE TYPE a1_array IS TABLE of a1;
    2.

    Type of creation.

    SQL > DECLARE
    v_a1 2 a1_array;
    3 v_a2 a1_array;
    4 BEGIN
    5 WITH temp
    6 AS (SELECT 1 a, 1 b, "AUS" AS region FROM DUAL
    7 UNION ALL
    8. SELECT 2 AS a, 2 b, "AUS" AS region FROM DUAL
    9 UNION ALL
    10. SELECT 3 a, b '3', 'NAM' AS region OF DOUBLE)
    11. SELECT a1 (x.a, x.b, x.region)
    In BULK 12 COLLECT IN v_a1
    Temp 13 x;
    14
    15 SELECT a1 (x.a, x.b, x.region)
    In BULK 16 COLLECT IN v_a2
    TABLE (v_a1) 17 x
    18 WHERE x.region = 'NAM ';
    19
    20
    21 FOR I IN 1... v_a2. COUNTY
    22 LOOP
    (23) DBMS_OUTPUT.put_line
    24 v_a2 (i) .a | '-' || v_a2 (i) .b | '-' || v_a2 (i) .region);
    25 END OF LOOP;
    26 END;
    27.
    3-3-NAM

    PL/SQL procedure successfully completed.

    SQL > spool off;

  • ORA-01789 - when you use the operator of TABLE and SEM_MATCH

    Client version: 11.1.0.7 on Windows 7 (32 bit)
    Server version: 11.2.0.3 on Windows 7 (64-bit)

    I am model prototyping a simple RDF, and I'm getting a ' ORA-01789: block has an incorrect number of columns in query results "when you use the SEM_MATCH with the SCOREBOARD operator.

    I can run this:
    select id, a.triple.GET_TRIPLE() from drik.rdf_data a
    and the first line is:
    (<http://www.ihc.com/drik/term#2>, <http://www.w3.org/2000/01/rdf-schema#subClassOf>, <http://www.ihc.com/drik/term#1>)
    Now, I want to use the TABLE like this:
    select
      c
    from 
      table(sem_match('{ <http://www.ihc.com/drik/term#2> <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?c . }', 
            sem_models('Prototype'),
            sem_rulebases('RDFS'),
            sem_aliases(sem_alias('rdfs','http://www.w3.org/2000/01/rdf-schema/')),
            null
            ))
    But this performance gives the ORA-07189. Even try SELECT * gives the same error.

    I expect to get a refund:
    <http://www.ihc.com/drik/term#1>
    How should I approach troubleshooting this?

    Thank you, Steve

    Thanks for posting the script. I was able to reproduce the error locally.

    The problem is the use of the sem_apis.create_rules_index () procedure, which has been deprecated:
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25609/sdo_rdf_newfeat.htm#autoId26

    Please use sem_apis.create_entailment () instead, and the error should disappear.
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25609/sem_apis_ref.htm#CHEHDGBD

    Thank you
    Matt

  • How to get a 'white' answer when you use 'if' statements in a table

    I use a table for an invoice where an element is classified, but more can be shipped as ordered. I have figured out formcalc expression where I can get a 0 in the column "out of stock" If the delivered quantity is more than the ordered article, but I can't get rid of a value of 0 in the rest of the column out of stock when all information "shipped" columns "orderly" and. Try to get this column blank if there is no order or shipping information.

    So far, it works for the math part. Don't know how to write an 'empty' in the calculation

    Sum(ordered-shipped)

    If (Sum(ordered-shipped) > 0)

    then backordered = Sum(ordered-shipped)

    ElseIf (Sum(ordered-shipped) < 0)

    then out of stock = 0

    endif

    Any advice will be greatly appreciated. Thank you!

    Have you checked the patterns listed for your numeric field in the object palette?

    This could be the cause for the zero. I tried on my system local and if I assign null, he demonstrated an empty value.

    KC

  • Is it Possible to use a function when you create a table?

    Hello

    Is it possible to use a function during the construction of a table?

    I would like to browse my data returned from the db and call a function. The part where I call the function "myFunction [i]" doesn't seem to work. How can I solve this problem? I need to put the function call results in the table.

    var i: uint;

    for (i = 0; i < dataArray.Length; i ++)

    {

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}];

    }

    Thank you!
    -Laxmidi

    Hi laxmi,

    Yes of course it is quite possible to use a function when you create a table... In your code, you made some mistakes...

    You used hooks to call the function myFunction [i]... where you are supposed to use parentheses... myFunc (i)... and other you must push the object in the dgArray but yous hould not not attribute...

    dgArray = [{name: dataArray [i] .name, Type: myFunction [i]}]; This will result in only the last table iterates in dgArray...

    So you should write dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});

    Check out the code below...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete ="init (); » >

      private var dgArray:Array = new Array();
    private var myDataArray:Array = [{data: '1', name: 'Robert'}, {data: '2', name: 'Nicolas'}, {data: '3', name: "Bika"}]
     
    private function init (): void
    {
    for (var i: int = 0; i
    {
    dgArray.push ({name: dataArray [i] .name, Type: (i) myFunction});
    }
    }
      
    private void myFunction(i:int):String
    {
    Return 'Type' + i;
    }
    ]]>

    If this post answers your question or assistance, please mark it as such.

    Thank you

    Jean Claude Chari

  • Bad performance on a table partitioned range when you use sysdate

    I have a partition table with a DATE partition key column.
    Tables servs as a sliding window this is by adding a new partiotion for each day and dropping out of the older partitions.
    Each week, I generate a weekly report:
    SELECT... FROM MaTable WHERE part-key-column > SYSDATE-7;
    This query runs for about 5 hours

    When you use a hardcoded hard 'day' the query is finished about 4 times faster
    SELECT... FROM MaTable WHERE part-key-column > TO_DATE ('20100211', 'YYYYMMDD');

    any suggestion?

    Qry Plans:

    First Qry (poor):
    SQL> explain plan for SELECT * FROM dwh_net1.net_na_messw  WHERE dwh_net1.net_na_messw.mdate > trunc(SYSDATE - 7);
    
    EXPLAIN PLAN ausgeführt.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                              
    ---------------------------------------------------------------------------------------------------------
    Plan hash value: 1311981634                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                   
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
    | Id  | Operation                | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |                                                                                                                                                      
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
    |   0 | SELECT STATEMENT         |              |  8479K|  3000M|  1975K (10)| 06:35:11 |       |       |                                                                                                                                                      
    |   1 |  PARTITION RANGE ITERATOR|              |  8479K|  3000M|  1975K (10)| 06:35:11 |   KEY |    61 |                                                                                                                                                      
    |*  2 |   TABLE ACCESS FULL      | NET_NA_MESSW |  8479K|  3000M|  1975K (10)| 06:35:11 |   KEY |    61 |                                                                                                                                                      
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
                                                                                                                                                                                                                                                                   
    Predicate Information (identified by operation id):                                                                                                                                                                                                            
    
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                              
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                   
       2 - filter("NET_NA_MESSW"."MDATE">TRUNC(SYSDATE@!-7))                                                                                                                                                                                                       
    Second (hardcoded, faster) Qry:
    SQL> explain plan for SELECT * FROM dwh_net1.net_na_messw  WHERE MDATE > to_date('12.02.2010','DD.MM.YYYY');
    
    EXPLAIN PLAN ausgeführt.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                              
    ---------------------------------------------------------------------------------------------------------
    Plan hash value: 1311981634                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                   
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
    | Id  | Operation                | Name         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |                                                                                                                                                      
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
    |   0 | SELECT STATEMENT         |              |  8479K|  3000M|   227K (10)| 00:45:30 |       |       |                                                                                                                                                      
    |   1 |  PARTITION RANGE ITERATOR|              |  8479K|  3000M|   227K (10)| 00:45:30 |    54 |    61 |                                                                                                                                                      
    |*  2 |   TABLE ACCESS FULL      | NET_NA_MESSW |  8479K|  3000M|   227K (10)| 00:45:30 |    54 |    61 |                                                                                                                                                      
    ---------------------------------------------------------------------------------------------------------                                                                                                                                                      
                                                                                                                                                                                                                                                                   
    Predicate Information (identified by operation id):                                                                                                                                                                                                            
    
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                              
    ---------------------------------------------------------------------------------------------------------
                                                                                                                                                                                                                                                                   
       2 - filter("MDATE">TO_DATE('2010-02-12 00:00:00', 'yyyy-mm-dd hh24:mi:ss'))                                                                                                                                                                                 
                                                                                                                                                                                                                                                                   
    Published by: user10396457 on February 19, 2010 12:27

    Your two says plans are exactly the same. Are you sure that the elapsed time are different. Can you please set autotrace to traceonly and run two statements and send the output.

  • How to fill the value in the nested table by using the object type


    Hi gurus

    I created an object type and able to fill the values in it, now I want to create a nested table type of this object and fill it but looks like I'm doing something wrong, see my code below.

    Code example

    CREATE or REPLACE TYPE countries_o
    AS
    OBJECT
    (
    COUNTRY_ID TANK (2 BYTES),
    COUNTRY_NAME VARCHAR2 (40 BYTE),
    REGION_ID NUMBER);
    /

    create or replace type countries_t is table of the countries_o;

    /

    CREATE OR REPLACE

    ABC of the PROCEDURE

    IS

    v_print countries_t; -: = arr_countries_t('01','Aus',1);

    BEGIN

    v_print: = countries_t('01','A',11);

    DBMS_OUTPUT. Put_line (v_print. COUNTRY_ID | v_print. COUNTRY_NAME | v_print. REGION_ID);

    END;

    /

    Error

    • Error (6.3): PL/SQL: statement ignored
    • Error (6,12): PLS-00306: wrong number or types of arguments in the call to 'COUNTRIES_T '.
    • Error (7.3): PL/SQL: statement ignored
    • Error (7.32): PLS-00302: component 'COUNTRY_ID' must be declared

    Thanks in advance

    Concerning

    Muzz

    Hi user,

    Here is another method that you can try-

    CREATE OR REPLACE

    ABC of the PROCEDURE

    IS

    v_print countries_t: = countries_t (countries_o('01','A',11));

    BEGIN

    DBMS_OUTPUT. Put_line (v_print (1).) COUNTRY_ID | v_print (1). COUNTRY_NAME | v_print (1). REGION_ID); -you're accessinf the first element of the nested table, which in turn points to the object.

    END;

    In the sections of the declaration you have assigned values to the nested table.

    Kind regards
    Maxou

Maybe you are looking for

  • Firefox is not install/uninstall/turn off/on all addon, although there is a constant message to restart firefox?

    I receive the message to restart firefox under Tools Addons. With all the extensions appear below they will be uninstalled when firefox will be restarted. Although they never get as well. I tried to install flashgot at the same time, that it will not

  • 6008 USB running random resets

    Hi all We use the USB-6008 to control both engines and acquire data from a number of motion sensors. We are the control with LabVIEW 2010 on Windows 7 on a laptop. Usually, it works fine, but sometimes without reason, that we can see the resets USB-6

  • DocProc Msi Question!

    Series of HP Photosmart C5200 All In One Model Printer - C5280 When I select Menu to analyze and choose a choice of scanning, he said the component that you are trying to use is on a CD-ROM or another removable disk that is not available. I put the C

  • Reformat and load the new system full of dv9925nr

    Reformat and full load new system need factory web site backup disk will not show order me form with the application of disc

  • Upgrade to version 6.0 SourceFire Module questions

    We have just implemented SourceFire Module version 5.4.1 on our ASA recently, but want to upgrade to version 6.0. I've been through Notes version 6.0 for the upgrade, which are dated to November 2015, but had a few questions that I was hoping someone