Using nested tables with User Defıned Types.....

Hi All,
I defined TEST_1 User Defined Type where VALUE_PART field is a VARCHAR2 type.
CREATE TYPE TEST_1 AS OBJECT (
               x NUMBER,
               y NUMBER,
     VALUE_PART VARCHAR2(50)
This TEST_1 object type will be used as nested tables in the EMPLOYEE table where each attribute might require different bytes of VARCHAR2’s in the VALUE_PART field.
CREATE TYPE NAME AS TABLE OF TEST_1;
CREATE TYPE ADDRESS AS TABLE OF TEST_1;
CREATE TYPE DEPARTMENT AS TABLE OF TEST_1;
CREATE TABLE EMPLOYEE (
SSN NUMBER,
NAME TEST_1,
ADDRESS TEST_1,
DEPARTMENT TEST_1,
SALARY NUMBER
NESTED TABLE NAME STORE AS NAME_TABLE;
NESTED TABLE ADDRESS STORE AS ADDRESS_TABLE;
NESTED TABLE DEPARTMENT STORE AS DEPARTMENT_TABLE;
Is it possible to specify VALUE_PART(50) in the TABLE OF statement?
Is there any way to do that throught methods or some other ways that I may not be aware of?
For Example:
/*This should allocate 10 bytes of VARCHAR2. */
CREATE TYPE NAME AS TABLE OF TEST_1(10);
/* and 30 bytes of VARCHAR2. */
CREATE TYPE ADDRESS AS TABLE OF TEST_1(30);
/*and 10 bytes of VARCHAR2. */
CREATE TYPE DEPARTMENT AS TABLE OF TEST_1(10);
Any help is appreciated.
Thanks a lot.

Hi,
We can not specify VALUE_PART(50) in the TABLE OF statement.
Regards,
Sailaja

Similar Messages

  • How to use nested tables with the inner table in a separate row

    Hi,
    I am having a problem when changing our existing Adobe printform delivery note so that serial numbers are written for each item line.
    I've searched the forum and found many posts relating to nested tables, but none that had exactly my situation.
    Currently I print item lines like this (this uses the complete width of the form):
    Pos....Quantity...Material..........Description..................................................Date
    99.........99.........ABCDEFGH....alksdalksjdlkasjdlsajdlkjasldjaslkdjakslj........9999.99.99
    .................................................fskdjflsdfljsdflkjsdlkfjsdlkjfdfsf
    .................................................asdkadsfdkfhsdkfhskjdfhks
    but I want to add serial numbers after that for each item like this:
    Pos....Quantity...Material..........Description...................................................Date
    99.........99.........ABCDEFGH....alksdalksjdlkasjdlsajdlkjasldjaslkdjakslj.........9999.99.99
    .................................................fskdjflsdfljsdflkjsdlkfjsdlkjfdfsf
    .................................................asdkadsfdkfhsdkfhskjdfhks
    .................................................Serial numbers:
    .................................................9999999999..9999999999..9999999999
    .................................................9999999999..9999999999..9999999999
    I have added serial numbers to my the current table in the interface/context/data view so it look like this:
    TTYP - ITEM_FIELDS
    ...DATA structure
    ......POSNR
    ......QTY
    ......MATNR
    ......TTYP - ITEM_TEXTS
    .........DATA structure
    ............DESCRIPTION
    ......DATE
    ......TTYP - SERIAL_NOS
    .........DATA structure
    ............SERIAL_COL1
    ............SERIAL_COL2
    ............SERIAL_COL3
    In my Hierarchy I currently have this hierarchy and binding:
    Table - ITEM_FIELDS
    ...Body Row - DATA
    ......Cell - POSNR
    ......Cell - QTY
    ......Cell - MATNR
    ......Subform - ItemTexts
    .........Table - ITEM_TEXTS
    ............Body Row - DATA
    ...............Cell - DESCRIPTION
    ......Cell - DATE
    Now I am trying to add the SERIAL_NOS table into the ITEM_FIELDS/DATA body row right after the DATE cell - but I am not allowed to drag anything into the table structure.
    Does anybody have an ida how I can achieve this, please?
    Kind regards,
    Claus Christensen

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • How to use nested table types with XDK

    Im using Oracles XDK (xml development kit) to create xml-documents from data in database.4
    Problem: I need to use nested tables but when trying to create nested table types I get error: A Table type may not contain a nested table type or VARRAY.
    Hope I make myself clear! Are there any solutions or workarounds to this problem?
    Help appreciated, thanks!

    Jesper,
    I asked similar question last year (search for Tapsell, you will see my posting). Under 8.1.7 the "nesting" seems restricted to one level down. Thus you cannot create a type using another object that itself includes a nested table. Under Oracle 9, against which most current examples seem based, this limitation is removed making things easier. Under 8.1.7 the workaround I have used is to use the CAST syntax. This is not as neat, but it works.

  • Nested tables of user defined types

    Hello all,
    I have philosophical question I am hoping someone can answer for me, "To TYPE, or not to TYPE; that is the question."
    I have created several layers of nested tables in the form:
    CREATE TYPE xyz AS OBJECT();
    CREATE TYPE table_xyz AS TABLE OF xyz;
    CREATE TYPE abc AS OBJECT(
    nested_table1 table_xyz;
    and so on until I end up creating a main table with all these sub tables nested into it.
    But from what I understand oracle stores all of the information in a column of type NESTED TABLE into a single table, rather than one table per row. This means that if I declare a primary key in the nested table it will be against all values in the outer column, not just limited to the values in an individual row of the outer table. Plus it will not let me create foreign keys with in a nested table.
    So why should I use the above construct instead of simply creating separate tables, and use primary and foreign keys to relate them and joins to query?
    I can see the use for types in small cases (addresses, person, etc..) but I do not see the advantage of nested tables. Could someone shed some light on the subject for me?
    Thanks,
    Thomas

    I'll state an opinion, for what it's worth. First, if you are going in the direction of types and nested tables or other collections, you are buying into Oracle's object-relational approach. This has pros and cons as far as design considerations, complexity, and performance that is too involved to get into here. If you just need master/detail table relationships, stick with traditional design techniques. Nested tables can make DML code complex and many tools can't deal with them so you end up having to unnest(flatten) the collections. I'd especially stay away from them if you require multiple nested tables or nested tables within nested tables.

  • Help how to create full set of nested table with given xml schema?

    Hi everyone, I am new to oracle and programming language. Recently I was asked to create nested table with given a complex xml schema. I knew that after the registration of xsd file, oracle will generate few tables( including nested table) and types for the users. But it seems to be not complete set of tables. Can anyone please help me with the problem. Really thanks a lot on the help given. I would like to give extra explanation if what I have given above is not clear enough. Thanks

    How about posting the XML Schema, the code you used to register it, the database version you are using and the list of nested tables that were generated...

  • Using nested tables

    Hi experts,
    is there a way of using nested tables, for example:
    Field1
    ---value1-1
    ------example1-1
    ------example1-2
    ------example1-3
    ---value1-2
    ------example2-1
    ------example2-2
    ------example2-3
    ------example2-4
    ------example2-5
    ---value1-3
    ------example3-1
    ------example3-2
    Field2
    ---value2-1
    ------example1-1
    ------example1-2
    Or isn't it possible?
    Thanks
    Michael

    Hi,
    Nested table is not allowed but if it is property structure like address etc which can be included in more than one entities then you can use complex type Complex Types - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
    you can refer this Odata Services with Complex Types and Netweaver Gateway : Multiple Output Tables : Odata | SCN
    Regards,
    Chandra

  • Loading Nested table with SQL Loader

    We have 15 nested tables in an table. Need help in creating a contol file. Tried with the syntax of object collection and didn't work. Can any none share the syntax please.
    -- Thanks,
    Phani Adusumilli

    Thanks Srini and Zoltan.
    I am able to figure out, here is the example with one nested table.
    CREATE OR REPLACE TYPE feature_count_type AS OBJECT (
    feature_type VARCHAR2(60),
    occurs INTEGER
    CREATE OR REPLACE TYPE feature_count_ntbl
    AS TABLE OF feature_count_type;
    CREATE TABLE PHANI_ADUSUMILLI(
    state VARCHAR2(2),
    county VARCHAR2(20),
    feature_count feature_count_ntbl
    ) NESTED TABLE feature_count
    STORE AS nested_feature_count_table;
    LOAD DATA
    INFILE *
    TRUNCATE INTO TABLE PHANI_ADUSUMILLI
    county CHAR TERMINATED BY ',' ENCLOSED BY '"',
    element_count FILLER INTEGER EXTERNAL TERMINATED BY ',',
    feature_count NESTED TABLE COUNT(element_count)
         dummy_name COLUMN OBJECT
         feature_type CHAR TERMINATED BY ',',
         occurs INTEGER EXTERNAL TERMINATED BY ','
    state CHAR TERMINATED BY ','
    BEGINDATA
    "Alger",5,lake,213,stream,88,falls,18,bay,11,island,5,MI
    "Marquette",6,lake,293,stream,145,falls,5,bay,8,island,5,summit,23,MI
    "Keweenaw",3,lake,86,falls,1,summit,16,MI

  • Retain standard SAP order type after copying with user defined order type

    Hello SAP Gurus,
    We have a requirement of retaining the standard SAP order types after copying with User defined order types. But the issue is we don't want to see the standard SAP order type such as PM01, PM02 in production system while using transaction like IW31 etc.
    Is there anybody who has answer to retain these stanadard SAP order types without deleting from system configuration?
    Thanks in advance.
    Cheers,
    Vaibhav

    Vaibhav,
    When you F4 on the order type field in IW31 you will get the popup showing the order type list. At the top of this list is a button with a green "+" sign (Insert in personal list).
    You can use this button to select your favourite list.
    This function is available in most F4 drop-down lists.
    However, you cannot set this setting for all users. You will need to write an ABAP program to do this.
    PeteA

  • OCI doc says Cursor and Nested table have the same bind type SQLT_RSET but they don't

    5 Binding and Defining in OCI
    PL/SQL REF CURSORs and Nested Tables in OCI
    says SQLT_RSET is passed for the dty parameter.
    If I use SQLT_RSET for the return value of a function that returns a table and pass a statement handle's address for the OCI parameter data pointer, I expected that the statement handle will be instantiated as a result of executing the function on which I can further perform fetch, similar to a cursor. But it throws exception PLS-00382: expression is of wrong type ORA-06550: line 2, column 3. Is the above documentation wrong?
    From the OCI header file I see that for varray and nested table it mentions to use SQLT_NCO. I could find no example in the OCI documentation on how to pass or receive as return value a nested value when using SQLT_NCO.
    Please help before I shoot myself.

    So the Nested table I quoted in the doc is not actually used to mean a table type below?
    create type t_resultsetdata as object (
    i int, d decimal, c varchar(10)
    create type t_nested_resultsetdata as table of t_resultsetdata;
    create function Blah return t_nested_resultsetdata  is . . .
    For this you are saying to use SQL_NTY and not SQL_NCO. Can you tell where this usage is documented, because ocidfn.h says
    #define SQLT_NTY  108                              
    /* named object type */
    #define SQLT_NCO  122 
    /* named collection type (varray or nested table) */
    Another question - Because of the original document I said I followed, I thought I could treat cursor and nested table similarly in the calling application, i.e. I could repeatedly do a fetch on the OCIStmt* which will be bound for nested table. Now from what you say I understand I can't really bind a OCIStmt* for nested table but have an object type. That means it will get all the data of that collection in one go, right? LIke I said, lack of examples is making this tough. I don't want to look into OCI source code, as that will be too much.

  • How to use nested tables object in oracle form

    Hello forum
    How all r u ..
    i need ur help guys, pls help me out...
    i m using an object oriented approach to design my database by using nested tables and
    varrays. it is quite done successfully.
    but the problem is when i m trying to use that object of nested table into the datablock of the form it is not been added to item list of that block.
    so what is the proper way to use these type of objects to the form.
    all ideas are welcomed and vry much required.
    pls give example if possible so easy to understand or have any demo form related to above case then pls post me to my id i.e [email protected]
    thank u all and expecting some expert solutions

    Hello Francois Degrelle...
    How r u doing ... i have searched the forum abt the above mentioned topic then i found that u have some demo form which will help out to explain the functionality of the nested table in forms ..
    will u pls me that form to my i.e [email protected] pls mail all the detail u have regarding using nested tables to forms and reports
    lots of thanks to u n advance.

  • What are the advantage of using nested table?

    what are the advantages of using nested table?
    and what are disadvantages of it?

    BTW could you edit the following post and remove the dangerous code
    Re: How to rename a database user?
    Some other poor sap has just fried their database by trying it out
    Re: Can I rename a user?
    Message was edited by:
    3360
    Thank you for making the edit

  • Help in joining nested table with regular table

    Im creating a nested table codelist as object prtcnpt_info. In a anonymous block im declaring t_code as nested table type codelist.
    Now when i try to join the nested table with the regular oracle DB table and i get error: PL/SQL: ORA-00904: "COLUMN_VALUE": invalid identifier.
    Please help me on this and provide tutorial link pertaining to this concepts..Below is the code i wrote
    --Code Start;
    create or replace type prtcnpt_info as object ( id number
    ,name varchar2(200)
    ,code varchar2(30));
    create type codelist is table of prtcnpt_info;
    declare
    t_code codelist;
    begin
    select prtcnpt_info(b.pid ,b.name ,pt.code) bulk collect into t_code
    from part pt
    ,mc_code b
    where pt.cd in ('AAA','BBB')
    and pt.ptype_id=b.pt_type_id;
    INSERT INTO table ( ID
    ,RUN_ID
    ,DATA
    ,P_ID
    SELECT id
         ,run_id
         ,data
         ,prtct.id ----> 1
    FROM table_2 t2
    ,(select column_value from table(t_code)) prtct
    WHERE prtct.id=t2.P_ID; ------> 2
    end;
    --Code End;
    also from the anonymous block
    1 => is this correct way to get value of id (b.pid) from the nested tablet_code aliased as prtct ?
    2 => is this correct way to join the nested table with regular table? i want to join the column id's in both the tables.
    Edited by: 914912 on Apr 30, 2012 2:11 AM

    When you create a table type without an object, i.e. a single column type like this you will get the column name as COLUMN_VALUE.
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Apr 30 07:38:32 2012
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create or replace type mytbl as table of varchar2(10)
      2  /
    Type created.
    SQL> var rc refcursor
    "afiedt.buf" 11 lines, 162 characters
      1  declare
      2     ltbl mytbl;
      3  begin
      4     select to_char(level) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9* end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    COLUMN_VAL
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.And when you create a table type with object you will get the object column name.
    SQL> drop type mytbl
      2  /
    Type dropped.
    SQL> create type myobj as object (id varchar2(10))
      2  /
    Type created.
    SQL> create type mytbl as table of myobj
      2  /
    Type created.
    SQL> declare
      2     ltbl mytbl;
      3  begin
      4     select myobj(to_char(level)) bulk collect into ltbl
      5       from dual
      6    connect by level <= 10;
      7     open :rc for
      8     select * from table(ltbl);
      9  end;
    10  /
    PL/SQL procedure successfully completed.
    SQL> print rc
    ID
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    10 rows selected.
    SQL>

  • How to use nested tables in adobe form

    Hi All,
    I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
    EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
    item--materialdescription-ordered qty--delivered qty--delivery date-price  
    xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
    10----
    xxxxxxxxxx
    10----
    xxxxxxxxxx
    yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy 
    xxxxxx is table 1 and will have multiple lines
    yyyyyy is table 2 and will have only 1 entry for item xxx
    and this group will be repeate as per no of items. table 1 can have any no of lines per item.
    I am currently able to display 1 line for table 1 and 1 line for table 2.
    But how to show multiple lines for table 1 and 1 line for table 2.

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • Problem about SSO using logon ticket  with user mapping

    Hi everyone ,
    I had done SSO with Portal , BW and R/3 system.
    I use logon ticket with user mapping .
    When user name is same in Portal as in R/3 system, or user name is same in Portal as in BW , user can access R/3 transactions and BW report without logon.
    There are some Portal users name which are different with R/3 user and  BW user. And I done the user mapping for these  user.
    But some user mapping works fine,but most of them can't work,means that most of them need to enter mapped user ID and password.
    What's the reason?
    When SSO using logon ticket with user mapping, the Portal user which is different with R/3 user and BW user,  can they access R/3 transaction iview and BW report iview without logon?

    Hi Chen,
    What you have done is correct. But the problem lies here.
    Since you are using the same system object for accessing the iview, where the ticket method is set to SAPLOGONTICKET in the user Management property of the system object.
    To avoid this create another system object like the previous one but set the logon method to UIDPW and select admin, user from the drop down box. Also create a system alias for this system.
    Now create another iview like the previous one but link this iview to the new system. Now do the user mapping for the users which are different in portal compared with R/3. Now you should be able to login without any problems.
    Another important point is login to portal with Fully qualified domain name. In the ITS property of the system object also give the FQDN.
    Hope this helps
    Regards
    Arun

  • Storing data in data bse using nested tables

    using nested tables data can be stored in data base or not.
    if yes i need simple example for taht and how to retireve the data from data base.

    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11822/adobjvew.htm#ADOBJ00511
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/composites.htm#LNPLS99981

Maybe you are looking for