Pre-defined types of Oracle nested table

Hello
I am in the Internet search and could not find one of the pre-defined types of nested table in Oracle. For example: a type that can contain strings. Can anyone put here a few names of this type?
create table mytable (id integer, theList sys.odcivarchar2list);

insert into mytable (id, thelist)
values ( 1, sys.odcivarchar2list('a','b','c'));

Tags: Database

Similar Questions

  • pre-defined types of missing data when using a configuration file

    Hi all

    I recently installed Labview signal express 2011, including the audio wizard and vibrations. I got a file preset to implement the material I have but when I open the configuration file (a Labview project file) I get a message:

    Version of installed components are not compatible with the version of LabView express signal 2012. Please install the latest version of the following:

    "SV express datatypes.

    I do not have Labview signal express 2012 so I do not understand why this error pops up. I also have difficulties in locating the mentioned software

    Please notify

    Hi Yogev_sharvit,

    There is not a way to save the files to a previous version of the Sound and Vibration Assistant. I encourage you to contact SAGE, who was the source of the files, and whether they have a 2011 version available. Otherwise, it may be necessary to configure the steps in the wizard. I've included a screenshot of the file opened below. Unfortunately, this does not bring as much light on the different steps that we would.

  • Error in initialization of multilevel nested table type

    Hello

    Database version: Oracle 11 g R2

    I am creating a complex process I need to create complex nested table types and use them in code.

    {code}

    CREATE or REPLACE TYPE ws_data_compare_rt

    AS AN OBJECT

    (

    external_web_service_id NUMBER (10),

    service_code VARCHAR2 (30),

    ws_bridging_id NUMBER (10),

    ws_attribute_name VARCHAR2 (64).

    ws_attribute_value VARCHAR2 (32767).

    in_source_attribute VARCHAR2 (30),

    in_source_value VARCHAR2 (32767).

    comparison_rule VARCHAR2 (100)

    );

    CREATE or REPLACE TYPE ws_data_compare_tt IS TABLE OF THE ws_data_compare_rt;

    CREATE or REPLACE TYPE ws_data_compare_master_rt

    AS AN OBJECT

    (

    key_attribute_1 VARCHAR2 (30),

    NUMBER of key_attribute1_value

    key_attribute_2 VARCHAR2 (30),

    NUMBER of key_attribute2_value

    m_ws_data_compare_tt ws_data_compare_tt

    );

    /

    CREATE or REPLACE TYPE ws_data_compare_master_tt IS TABLE OF THE ws_data_compare_master_rt;

    {code}

    The objects have been created successfully. However when I use it in my code, I need to initialize them, but I get an error for the variable of ws_data_compare_master_tt type initialization.

    {code}

    ...

    g_ws_data_compare_rt ws_data_compare_rt: = ws_data_compare_rt (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

    g_ws_data_compare_tt ws_data_compare_tt: = ws_data_compare_tt();

    g_ws_data_compare_master_rt ws_data_compare_master_rt: = ws_data_compare_master_rt (NULL, NULL, NULL, NULL, g_ws_data_compare_tt);

    g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();

    ...

    {code}

    I'm unable to initialize the variable g_ws_data_compare_master_tt of type ws_data_compare_master_tt that I get the below error.

    For PACKAGE BODY UTL compile errors. PKG_WS_UTIL

    Error: PLS-00222: no function with name 'WS_DATA_COMPARE_MASTER_TT' does exist in this scope

    Line: 28

    Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();

    Error: PL/SQL: ignored element

    Line: 28

    Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();

    Can someone help me to find out what is the problem?

    Thanks in advance.

    Kind regards

    Natarajan

    Ah, I found the problem on my own. It was because of a bad statement similarly variable g_ws_data_compare_master_tt in a table in the specification of the package that was trouble. However I wonder the error returned Oracle was not fully exposed.

    Kind regards

    Natarajan

  • List of tables of objects or the user-defined type columns

    Hello

    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

    I have n number of tables in my db, since I have several
    tables containing "user defined type columns.
    so, how can I get/list db objects that contains the user-defined type columns only.
    Please suggest me on this

    Kind regards
    Faiz

    Dear Sir

    I have n number of tables in my db,from that i have several
    tables which contains"user defined type columns"
    so how could i get/list the db objects which contains user defined type columns only.
    Kindly suggest me on this
    

    Use this

    select
          tab.table_name
        , tab.column_name
        , tab.data_type
    from
        user_tab_columns tab
      , user_types typ
    where
        tab.data_type = typ.type_name
    order by
        tab.table_name
        ;
    

    Best regards

    Mohamed Houri

  • Error in the importation of tables with nested table types

    Hello

    I have two tables with the nested table type when I m try to import a schema to another all tables with error to give the type of identifying different

    Here is my order of import
    imp leader = tables_nested.dmp ignore = y fromuser = ABC touser = DEV_SCHEMA toid_novalidate = sup_payment_type
    I tried to import with the option TOID_NOVALIDATE, but it says
    IMP-00086: TOLD 'SUP_PAYMENT_TYPE' not found in the export file


    Here, the view of my log file.

    . . table import 'CONTRACT' 788 imported lines
    . . importation of "EQUIPMENT" 4301 imported table lines
    . . rows in table 'CONT_EQUIPMENT' import imported 4300
    IMP-00017: statement failed with error ORACLE 2304:
    "CREATE TYPE"SUP_PAYMENT_TYPE"TIMESTAMP" 2007-11 - 28:10:50:50' OID "3FF6F10."
    "CADC08A99E040A8C0010178F9"AS OBJECT ().
    "CONT_NO NUMBER".
    "EQP_NO NUMBER".
    "PMT_NO NUMBER".
    'DATE OF PLAN_PMT_DATE '.
    "S_NO NUMBER".
    "BATCH_NO NUMBER".
    'DATE OF TRAN_DT '.
    'DATE OF ACTUAL_PMT_DATE '.
    "ACTUAL_PAID_AMT_CURR NUMBER".
    "ACTUAL_PAID_AMT_KZT NUMBER".
    "PMT_CURSTYP_CD NUMBER".
    'NUMBER OF PMT_EXG_RATE);'
    IMP-00003: ORACLE error 2304
    ORA-02304: invalid literal object identifier
    IMP-00063: WARNING: jump table "DEV_SCHEMA". "" SUPPLIER_PAYMENT "as the type of the object
    'DEV_SCHEMA '. "' SUP_PAYMENT_TYPE ' could not be created or has identify different
    About to activate the constraints...

    Thank you

    Baptist

    Get the error on tahiti, I realized this must be a common problem and is described in Metaclunk.
    So in Metaclunk I get "ora-02304 imp' and came up with 1066139.6 ML.
    It describes your situation.
    So many times, it is very easy to solve your problems in a few minutes. I always wonder why people walk immediately into shock and horror and nothing to do when they hit a mistake.

    ----
    Sybrand Bakker
    Senior Oracle DBA

  • Oracle 9 error: insert into temp-table collection (nested table)

    Hello everyone

    I have an urgent problem. I have a package which has been developed against 10g but must now be deployed on 9i as well. I don't use 10 g - features and packages compile well on 9.

    Somehow, I get the following runtime error: failed execution: ORA-22905: cannot access the rows of a no nested table item.

    The Code I use to the particular line is

    insert into tmp_report_calculation (select from table (calculations)); *

    tmp_report_calculation is a temporary table and calculations holds a collection type that is a nested table. I do not understand why the error is complaining about "No nested table. Less than 10g everything run took place.

    Can someone help me out here? Furthermore, it is important that I put the results in this temp-table (since I can't use the multiset on Oracle 9)

    concerning
    -Marc

    Try

    insert into tmp_report_calculation (select * from table(cast(calculations as your_collection_type)));
    

    replace"your_collection_type" with your name in the actual collection of course...

  • 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

  • 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

  • What is the preferred means of data transmission as a type of record between the nested table of pl/sql program or an associative array

    What is the preferred means of data transmission in the associative array of the nested table record vs

    Choose between Nested Tables and associative arrays

    The two nested tables and associative arrays (formerly index - by tables) use similar index notation, but they have different characteristics when it comes to persistence and ease of passing parameters.

    Nested tables can be stored in a column of data, but can of associative arrays. Nested tables can simplify the SQL operations where you would normally join a single-column table with a larger table.

    Associative arrays are appropriate for relatively small lookup tables where the collection can be constructed in memory whenever a procedure is called or a package is initialized. They are good for the collection of the information volume is unknown beforehand, because there is no fixed limit on their size. Their index values are more flexible, as associative array indices can be negative, can be no sequential and can use values of string instead of numbers.

    PL/SQL automatically converts between the bays of the host and the associative arrays that use values of digital keys. The most effective way to move the collections to and from the database server is to implement data values in associative arrays, and then use these associative arrays with erections in bulk (the FORALL statement or BULK COLLECT clause).

    With the help of documents and Collections of PL/SQL

    Read this:

    How to pass the record set as a parameter of the procedure.

    https://community.Oracle.com/thread/2375173?TSTART=0

  • Nested table of object type have only one record all the time

    Hi all

    I have a question regarding the storage of multiple records in a nested Table that is of type OBJECT.

    The program below that I wrote for the test and during the test, I was able to store only the last record in the nested Table.

    Please let me know what I did wrong here.

    Step 1:
    CREATE or REPLACE TYPE book_obj AS OBJECT (name varchar2 (25), author varchar2 (25), abstract varchar2 (4000));
    /

    Step 2:
    CREATE or REPLACE TYPE book_table IS TABLE OF THE book_obj;
    /

    Step 3: CREATE TABLE book (name, varchar2 (25), varchar2 (25) author, varchar2 (4000)) abstract;
    INSERT VALUES Accountants ('Harry Potter,' 'MK', 'It's magic');
    INSERT the book VALUES ("Ramayana', 'VK', 'It is mythiology'");
    COMMIT;

    Step 4:
    declare
    bookset book_table;
    ln_cnt pls_integer;
    Start
    bookset: = book_table (book_obj ('madhu', 'kongara', 'sudhan'));
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I see COUNT = 1
    bookset: = bookset_t(); -> Assignment to NULL.
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I see County 0
    for rec in (select * from book) loop-> now a loop twice.
    dbms_output.put_line (' name > ' |) Rec.Name);
    bookset: = bookset_t (book_t (rec.name, rec.author, rec.abstract));
    end loop;
    dbms_output.put_line (' the number is ' | bookset.) (Count); -> I can see COUNT = 1 (why?)
    END;

    I looped twice to fill two records in the TABLE IMBRIQUEE OF TYPE OBJECT. But when I see the Count I get only 1 and the data is also having the last record.

    Can you get it someone please let me know how to fill out the table nested with all records. Tell me where I am wrong.

    Very much appreciate your help here.

    Thank you and best regards,
    NKM

    Maldini says:
    dbms_output.put_line (' the number is ' | bookset.) (Count); -->, I can see COUNT = 1 (why?)

    Because instead of add to bookset collectionto set (ergo replacement) it a collection containing recovered book. Use:

    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        for rec in (select * from book) loop --> Now Looping two times.
          dbms_output.put_line(' name > '||rec.name);
          bookset.extend;
          bookset(bookset.count) := book_obj(rec.name, rec.author, rec.abstract);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    /
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Or better use bulk collect:

    declare
        bookset book_table;
        ln_cnt pls_integer;
    begin
        bookset := book_table(book_obj('madhu','kongara','sudhan'));
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1
        bookset := book_table(); --> Assigning back to NULL.
        dbms_output.put_line('The count is '||bookset.count); --> I can see count as 0
        select  book_obj(name,author,abstract)
          bulk collect
          into  bookset
          from  book;
        for i in 1..bookset.count loop --> Now Looping two times.
          dbms_output.put_line(' name > '||bookset(i).name);
        end loop;
        dbms_output.put_line('The count is '||bookset.count); --> I can see COUNT =1 (why)
    end;
    /
    The count is 1
    The count is 0
    name > Harry Potter
    name > Ramayana
    The count is 2
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Fill in the data in an Excel template (with pre-defined formulas) Oracle

    Hello

    Anyone know how I can fill (with PL/SQL) Oracle data in an Excel template (with pre-defined formulas)? I mean that the user provides the Excel model so I just transfer the data from Oracle in particular cells in the worksheet. The model can be large and can become 50 pages long.

    Thank you.
    Andy

    So, you want an Oracle process or a process of APEX to take an existing Excel file and simply plug data into it? What I would say is instead, you export your data out and into your writing Excel VBA code file to take you input file and treat it accordingly.

    Thank you

    Tony Miller
    Webster, TX

    You can get more with a kind word and a legacy, you can with just a kind word

  • How to use the Type of Oracle Table values in the Select statement.

    Hello

    I get the initial set of values in the Table of Type Records of the Oracle and want to use the list of values in the Select statement.

    For example, try something like the following:

    TYPE t_record () IS RENDERING
    ID TABLEA.ID%type,
    NO TABLEA.NO%type

    );
    v_record t_record;
    T_table TYPE IS the v_record TABLE % TYPE;
    v_table t_table;

    -Code to fill the values of v_table here.

    SELECT ID, NO, COLLECT in BULK IN < some other table variabes here > FROM TABLEA
    WHERE ID IN (i) v_table USER.USER;

    I want to know how to use the Type of Oracle Table values in the Select statement.

    Something like this:

    create or replace type t_record as  object (
    id number,
    no number
    )
    /
    
    CREATE or replace type t_table AS TABLE OF t_record;
    /
    
    set serveroutput on
    declare
    
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    
    begin
    
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
    
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
    
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
    
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /
    

    No test!

    P;

    Published by: bluefrog on March 5, 2010 17:08

  • problem of nested table...

    Step - I, create a user defined type.

    Create the color_type type is object
    * (color_name varchar2 (100), *)
    color_short_desc varchar2 (30)
    *);*


    Stage-II, to create a nested type using the Type to define the user;

    Create the type color_nt is table of the color_type;

    Step - III, creating a Table, nested type used in this table ((deuxieme column)

    create the table m_color
    * (color_id number (10) not null, *)
    color_desc color_nt)
    store table nested like color_desc_nt; color_desc

    Stage-IV, enter the value in the table...

    insert into m_color values (1, color_nt)
    color_type ('white', 'wh')
    *));*

    but his returns an error...
    * ORA-00600: internal error code, arguments: [kokeeafi1], [3], [2], [], [], [], [], [], [], [], [], [] *.

    How to solve this problem... Please help me...

    Patricia wrote:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

    I can't reproduce it:

    SQL> select * from v$version
      2  /
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> create type color_type is object
      2  (color_name varchar2(100),
      3  color_short_desc varchar2(30)
      4  );
      5  /
    
    Type created.
    
    SQL> create type color_nt is table of color_type;
      2  /
    
    Type created.
    
    SQL> create table m_color
      2  (color_id number(10) not null,
      3  color_desc color_nt)
      4  nested table color_desc store as color_desc_nt;
    
    Table created.
    
    SQL> insert into m_color values (1, color_nt(
      2  color_type('white', 'wh')
      3  ));
    
    1 row created.
    
    SQL> 
    

    SY.

  • 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

  • Need help - multilevel nested table - create table problem

    Hello

    My version of oracle db: 11g

    I just created a table that contains a nested multi-level table.

    Here is the code:

    create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);

    create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);

    create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;

    create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);

    create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21  <-I know that the problem is here.

    TRACE OF THE ERROR:

    Error at startup on line: 13 in the command.

    create the table nt_dep21

    (number of fact

    , dname varchar2 (50)

    c_sdef_t_nt_empNames21 sdef_t_nt_empNames21

    c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)

    nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store

    Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21

    Error report-

    SQL error: ORA-00904: invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through

    I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.

    Concerning

    Rahul

    SQL > create table (nt_dep21)
    Did number 2,
    3 dname varchar2 (50).
    4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
    c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
    6                       )
    store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
    store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
    9 table nested as NT_sc sc store
    10                                                                               )
    11.

    Table created.

    SQL >

    SY.

Maybe you are looking for

  • How long the mid 2007 iMac, running El Capitan 10.11.6 rely on Apple?

    Hi all I was dreading the day where it would happen, but with the release of the Sierra of the OS, I see that my iMac mid 2007 is no longer able to update for Sierra. I am El Capitan 10.11.6 running without any problems and always up-to-date security

  • TPT2 button / stop stuck

    Someone had problems with the power button / stuck? I have similar problems mentioned in the post on the forum about problems after extended sleep. http://forums.Lenovo.com/T5/ThinkPad-Slate-tablets/TPT2-problems-after-prolonged-sleep/TD-p/979927 Aft

  • Launcher

    I'm eager to try another Launcher on my 6.0.1. system, but I would like to be sure, I know how to uninstall it before doing so. Where can I find the Launcher? And how is it installed? If it needs to be located alongside other applications, what is hi

  • I need to know how to use the efax on my Photosmart new.

    Let me know hoe to get it going

  • Lexmark X 2600 all-in-one printer cannot communicate with computer

    I'm running a xps dell system with windows edition 32-bit home premium. All of a sudden my printer lexmark x 2600 stop scanning so I uninstalled and reinstalled. Now not only the scanner does not work, but I can't print documents. I uninstalled and r