Collection Of Collection

Hi there,
I need to pass a collection which has a collection of nested table from Pl/sql.I want to know whether it is possible in Oracle 9i or not.If possible, can anyone send me some the code for achiveing it??.I will the following nested table type
SQL> create or replace type dup_pax_ty
2 as object
3 (pax_first_name varchar2(50),
4 segment_id number(5),
5 dup_pnr_number varchar2(50))
6 /
Type created.
SQL>
SQL> create or replace type dup_pax_nt
2 as table of dup_pax_ty
3 /
Type created.
SQL>
SQL> create or replace type dup_pnr_ty
2 as object
3 (pnr_number varchar2(15),
4 dup_pax dup_pax_nt )
5 /
Type created.
SQL>
SQL> create or replace type dup_pnr_nt
2 as table of dup_pnr_ty
3 /
Type created.
I want to pass a collection of DUP_PNR_NT from Oracle to Java...I would appreciate if you can send me the pl/sql code to send data and also the java code to accept the data.
Thanks,
Gracelin

am i missing somthing? it is working for me
SQL> select * from v$version
  2  ;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE    9.2.0.8.0       Production
TNS for HPUX: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production
SQL> DECLARE
  2    TYPE t_a IS RECORD (
  3      x                     VARCHAR2 (32767),
  4      w                     NUMBER
  5    );
  6 
  7    TYPE t_a_dtl IS VARRAY (10000) OF t_a;
  8 
  9    TYPE t_b IS RECORD (
10      y                     VARCHAR2 (10),
11      z                     t_a_dtl
12    );
13 
14    TYPE t_b_dtl IS VARRAY (10000) OF t_b;
15 
16    i                     NUMBER := 1;
17    ii                    NUMBER := 1;
18    p_b                   t_b_dtl := t_b_dtl ();
19  BEGIN
20  --
21    p_b.EXTEND (1);
22    p_b (i).z.EXTEND (1);
23    p_b (i).y      := 'celio';
24    p_b (i).z (ii).x := 'item1';
25    DBMS_OUTPUT.put_line(p_b (i).z (ii).x);
26  END;
27  /
item1
PL/SQL procedure successfully completed.

Similar Messages

  • Prime Infrastructure 2.0: Inventory Collection - Partial Collection Failure on 2 of 4 VSS WS-C6509-E

    Hello,
    I've got a strange behaviour regarding the inventory collection for 2 of 4 virtual switching systems.
    That means the inventory collection for two VSS is succesfull (inventory collections status = Completed) for the other two systems it is not, see attachments.
    The device credentials like SNMP-RW, SSH acces are OK. I've already tried to increase SNMP timout and retries as well as telnet/ssh timout without success
    All 4 systems are identical regarding hardware model and software vesion.
    HW: WS-C6509-E
    SW: 12.2(33)SXJ3
    Any ideas or suggestions?
    Best regards,
    Bastian

    TAC and I found a bug, CSCum05301.
    May be that is also helpfull for others.
    https://tools.cisco.com/bugsearch/bug/CSCum05301/
    Symptom:
    Inventory collection will fail if following keywords are used as part on description command on the interface config level of IOS device: 1Gbps, 10Mbps etc.
    Following error message is visible on the DWC:
    Inventory Collection Status: Partial Collection Failure
    Collection Status     Failed feature(s)
    Unable to configure DSL, Serial, POS, Ethernet, Loopback, Virtual-Interface, Tunnel, Vlan, Switchport and Service Module interfaces on ISR, ASR and Switches.
    Conditions:
    Speed keywords like 1Gbps, 10Mbps etc. available as part of descrption command in IOS interface level.
    For example:
    interface FastEthernet0/3
    description 10Mbps
    Workaround:
    Use a space character between number and unit keyword, like 1 Gbps.

  • Collection in collection using Struts

    I know we can submit the value of value object in collection using the following code.
    <logic:iterate id="collection" name="form" property="collection">
    <html:hidden indexed="true" name="collection" property="code" />
    </logic:iterate>
    But how about collection in collection? Is this possible in struts?
    Thanks in advance

    What you say is indeed the way to use struts.
    But I dont want to define in my jsp which fields of the Company object I want to display. I just want to loop through array of Collections and display them on my screen.
    I would like to ask the EJB for example getCompanyByName which returns me a array of Collections : (Company a, street 1) , (Company b, street 2)
    If I call getCompanyByStreet it returns me (street 1, Company a), (street 2, Company b)
    Thanks
    Nathalie

  • Smart Collection by Collection Sets?

    Hey all,
    Quick question on creating a Smart Collection within a Collection Set:
    Here's the deal:
    I have a collection set.  In it, I have a collection of about 358 photos.  From there, I rated the photos.  I then tried to create a Smart Collection from within that Collection Set, searching for photos that are 3 stars or above as my only criteria.  I targeted the Collection Set as the place where the Smart Album should be created.  (So it's Collection Set > Collection and Smart Collection)
    The issue is, with 3 stars and above being the only criteria selected, it is picking 3 stars and above from across my entire library, (returning about 17,000 photos that meet this criteria).
    I only want "3 stars and above" from this particular collection set, but without having to add additional criteria (I am coming from Aperture, and this was easy to do by "Project." )
    Is there a way to do this in Lightroom per collection set?  I added a keyword as an additional criteria, and with 2 rules, it works the way I would like, but I really was hoping that Smart Albums could search by Collection Set and not across the entire library.
    Any tips?
    Thanks!
    GG

    GG,
    Smart Collections always work on the entire catalog. You'd have to include the collection name as a additional criteria to achieve what you want.
    Beat Gossweiler
    Switzerland

  • Collection Specialist - Collections Profile Tab of Business Partner.

    Hi,
    We are using the SAP FSCM Collections Management module. When I assign the collection profile to the Business Partner on the Collections Profile Tab, the Collection Segment, Collection Group are populated based on the configuration but the Collections Specialist does not get populated.
    Can someone please throw some light on this if they have experienced this issue?
    Thanks & Regards,
    Bhairav Naik.

    Hello Mark , actually I dont think that is possible to transfer data related to collection profile (displayed in BP master data for a BP with colletion managemnt role) from Cusotmer master data because this kind of information are not availabe as my knowledge in Cusotmer master
    Solution could to transfer all other available data from Cusotmer data to BP and once transferred update mannually the collection profile.
    I have seen also a program ( transaction UDM_BP_PROF) to update collection profile automatically, but I did not manage to make it work on a exidting BP.
    What do you think about this approach?

  • Ordering of Collection Sets and Collections (inside Collection Sets)?

    What are the rules for how elements (specifically, collections and other collection sets) are ordered within a collection set?
    I was trying to get a collection to appear at the top of the list of items in a collection set, but it seems to get stuffed below all the other collection sets regardless of the name given to the collection.
    -Strathglass

    Collection Set / Smart Collections / Collections (Alphabetical in each case)
    The same applies inside a Collections Set.
    So a collection will never appear above a smart collection or collection set regardles of it name. If you create a Collection Set then create two Sets within (01, 02) Set 01 could contain Collections and thereby would appear above smart collections in set 02.

  • Doubt with Collections.singleton(Collection)

    Hi,
    can anyone help me in understanding the difference between.
    Collection.removeAll(Collection)and
    Collection.removeAll(Collections.singleton(Collection)).
    Thanks in advance....
    regards,
    Deep

    The difference is merely that the second one is pointless.

  • How to query a Collection for Collection rules (Powershell only)

    I have :
     $Collection = gwmi -computer MyServer -namespace "root\sms\Site_XXX" -class "SMS_Collection"
     $MyCollection = $collection | where { $_.Name -eq "TEST" }
    $MyCollection have a property named CollectionRules
    I could'nt manage to read this property,
    nor $MyCollection.CollectionRules
    nor  $MyCollection.CollectionRules | % { $_ }
    is Working.
    Any help on this ?

    Hi, 
    the above code works, but if you have a large environment then it may take a long time to run as you are querying for every collection before looking for the 'TEST' collection.
    The following code only looks (filters) for the specific collection so should execute much faster.
    $Collection = gwmi -computer MyServer -namespace "root\sms\Site_XXX" -class "SMS_Collection" -filter "Name='TEST'"
    $Collection.Get()
    $Collection.CollectionRules | % { $_ }
    Another method of doing the same would be this:
    $Collection = Get-WMIObject -computer MyServer -namespace "root\sms\Site_XXX" -query "Select * FROM SMS_Collection WHERE Name = 'TEST'"
    $Collection.Get()
    $Collection.CollectionRules | % { $_ }
    Hope you or someone else may find this useful :)

  • Multiple collections - which collection properties win?

    Hi,
    In short: if a device is in multiple collections, which collections properties win?
    More info, I have 2 collections:
    1 contains a config baseline (and therein config items) - Membership is to the 'All Mobile Devices' built-in collection
    1 contains 10 apps - Membership is to query all Windows Mobile devices
    The membership works fine. If I change the properties of either of the collections, such as Power Management which I want to select "Never Apply Power Mgmt...", does either take priority and if so how, or do both need it? How can I tell?
    I'm trying to do the above but having inconcistent results, hence the q.
    Thanks,
    Piers

    Have a look here
    http://technet.microsoft.com/en-us/library/gg712684.aspx
    If a computer is a member of multiple collections, each applying different power plans, then the following actions will be taken:
    Power plan: If multiple values for power settings are applied to a computer, the least restrictive value is used.
    Wakeup time: If multiple wakeup times are applied to a desktop computer, the time closest to midnight is used.
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Convert Collection to Collection Object w/o warnings

    Hi,
    How to make conversion between Collection and Collection<Object>?
    // we have an unknown object obj which was dynamically instantiated with
    // reflection API: Class.forName( xxx ).newInstance()
    if ( Collection.class.isAssignableFrom( obj.getClass() ) ) {
      Collection col = (Collection) obj;
      readCollection( col );  // here we have a warning
        static void readCollection( Collection<Object> col) throws IOException
             int size = in.readInt();
             for ( int i = 0; i < size; i++ ) {
                  Object o = readObject();
                  col.add( o );
        }Anton

    Change :
    static void readCollection( Collection<Object> col) throws IOException
    To :
    static void readCollection( Collection<?> col) throws IOException
    Hope it helps,
    Daniel Campelo

  • Needed help in bulk collect using collections

    Hi,
    I have created a schema level collection like "CREATE OR REPLACE TYPE T_EMP_NO IS TABLE OF NUMBER ;
    will i able to use this in a where clause which involves bulk collect?
    Please share ur thoughts.
    My oracle version is 10g

    user13710379 wrote:
    Will i be able to do a bulk collect into a table using this collection of my sql type?Bulk fetches collects into an array like structure - not into a SQL table like structure. So calling a collection variable in PL/SQL a "+PL/SQL table+" does not make much sense as this array structure is nothing like a table. For the same reason, one needs to question running SQL select statements against PL/SQL arrays.
    As for your SQL type defined - it is a collection (array) of numbers. Thus it can be used to bulk fetch a numeric column.

  • Select from a collection of collections SELECT - CAST - MULTISET - TABLE

    Does someone have a suggestion for the SELECT statement which is performing a CAST?
    I am on Oracle 10.2.0.1.0. The goal is to take a collection of a nested table and order it by color, then descr, then grown_by, saving it into an ordered collection (v_List2). Am getting error with ORA-22907 Invalid cast to a type that is not a nested table.
    CREATE OR REPLACE TYPE     ot_fruit
    AS OBJECT
        descr            VARCHAR2(100)
       ,color          VARCHAR2(50)
       ,grown_by          VARCHAR2(50) 
    CREATE OR REPLACE TYPE tab_fruitList AS TABLE OF ot_fruit;
    CREATE OR REPLACE TYPE     ot_tab_fruit
    AS OBJECT
        fruit            tab_fruitList
    DECLARE
       v_List  ot_tab_fruit := ot_tab_fruit(tab_fruitList(ot_fruit('apple','red','tree'),
                                                          ot_fruit('blueberry','blue','bush')
       v_List2 ot_tab_fruit := ot_tab_fruit(tab_fruitList());
    BEGIN
      SELECT CAST ( MULTISET ( SELECT * FROM TABLE(v_List)
                               ORDER BY 2, 3, 1
                               <b> -- This compiles with ORA-22907 error
                                  AS  ot_tab_fruit</b>
                  ) INTO v_List2
      FROM DUAL;
      FOR i IN v_List2.FIRST..v_List2.LAST
      LOOP  
         DBMS_OUTPUT.PUT_LINE('i='||i||' descr='||v_List2(i).fruit.descr ||' color='||
               v_List2(i).fruit.color||' grown_by='||v_List2(i).fruit.grown_by);
      END LOOP;
    END;Thanks, Kate
    Message was edited by:
    johnsok

    This solution, which works perfectly by the way, came from Avi Abrami. I've highlighted the necessary changes to make the SELECT of a collection of objects work properly.
    create or replace type OT_FRUIT as object (
      DESCR     varchar2(100)
    ,COLOR     varchar2(50)
    ,GROWN_BY  varchar2(50)
    create or replace type TAB_FRUITLIST as table of OT_FRUIT;
    create or replace type OT_TAB_FRUIT as object (
      FRUIT  TAB_FRUITLIST
    DECLARE
       v_List  ot_tab_fruit := ot_tab_fruit(tab_fruitList(ot_fruit('apple','red','tree'),
                                                          ot_fruit('blueberry','blue','bush')
       v_List2 ot_tab_fruit := ot_tab_fruit(tab_fruitList());
    BEGIN
      SELECT CAST ( MULTISET ( SELECT * FROM TABLE(v_List.fruit)
                               ORDER BY 2, 3, 1
                                  AS tab_fruitlist
                  ) INTO v_List2.fruit
      FROM DUAL;
      FOR i IN v_List2.fruit.FIRST..v_List2.fruit.LAST
      LOOP
         DBMS_OUTPUT.PUT_LINE('i='||i||' descr='||v_List2.fruit(i).descr ||' color='||
               v_List2.fruit(i).color||' grown_by='||v_List2.fruit(i).grown_by);
      END LOOP;
    END;
    /

  • Can we run parallel data collections to collect multiple source instance.

    Hi,
    We have a business requirement where we will have multiple Source(ERP) instance and single Destination(ASCP) instance. We would like to check if we will be able to run Data collections in parallel to collect multiple EPR instance in the same time window. This is to reduce the total planning process time duration as following data collections we will be required to run multiple plan runs.
    Please help me with your expert comments
    Rgds
    Sid

    You may instead use Continuous collections to save on time so it can run collections from both instances periodically throughout the day thereby reducing a single timespan to collect all the data.
    Thanks
    Navneet Goel
    Inspirage

  • Collection Of Collections

    Hi all,
    I am dealing with a search page which is having 8 search fields. i have a way for individual search fields. but i need to have multiple search.. with any to any combination in all the 8 fields. for this I need a List or an ArrayList which can hold Lists aagain.
    Eg:
    List a = null;
    List b = null;
    List c = null;
    List d = null;
    /* I want List d to hold the above 3 lists...
    List d ={List a , List B, Listc }*/
    it need not be a list only.. any collection which can hold any other collections.
    If any one knows it pls reply.

    No problem, a List (more precisily an ArrayList) can hold a list of any objects including other Lists. Just do:  List d = new ArrayList();
      d.add(a);
      d.add(b);
      d.add(c);--lichu                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem Collection of Collection with plsql

    declare
    TYPE t_a is record (
    x VARCHAR2(32767),
    w number
    TYPE t_a_dtl IS VARRAY (10000) OF t_a;
    TYPE t_b is record (
    y varchar2(10),
    z t_a_dtl
    TYPE t_b_dtl IS VARRAY (10000) OF t_b;
    i number := 1;
    ii number := 1;
    p_b t_b_dtl := t_b_dtl();
    begin
    p_b.extend(1);
    p_b(i).z.extend(1);
    p_b(i).y := 'celio';
    p_b(i).z(ii).x := 'item1';
    -- p_b(i).z(ii).w := 1;
    -- ii := ii+1;
    -- p_b(i).z(ii).x := 'item2';
    -- p_b(i).z(ii).w := 2;
    end;
    declare
    ERROR at line 1:
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at line 23

    am i missing somthing? it is working for me
    SQL> select * from v$version
      2  ;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE    9.2.0.8.0       Production
    TNS for HPUX: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    SQL> DECLARE
      2    TYPE t_a IS RECORD (
      3      x                     VARCHAR2 (32767),
      4      w                     NUMBER
      5    );
      6 
      7    TYPE t_a_dtl IS VARRAY (10000) OF t_a;
      8 
      9    TYPE t_b IS RECORD (
    10      y                     VARCHAR2 (10),
    11      z                     t_a_dtl
    12    );
    13 
    14    TYPE t_b_dtl IS VARRAY (10000) OF t_b;
    15 
    16    i                     NUMBER := 1;
    17    ii                    NUMBER := 1;
    18    p_b                   t_b_dtl := t_b_dtl ();
    19  BEGIN
    20  --
    21    p_b.EXTEND (1);
    22    p_b (i).z.EXTEND (1);
    23    p_b (i).y      := 'celio';
    24    p_b (i).z (ii).x := 'item1';
    25    DBMS_OUTPUT.put_line(p_b (i).z (ii).x);
    26  END;
    27  /
    item1
    PL/SQL procedure successfully completed.

Maybe you are looking for

  • It is possible to display a graph in smartforms

    Hi, In report , i am displaying the graph similary i want to   print the graph in smartforms. Plz give me details . Wht is spf ? Regards, Rani.

  • Variables in Queries

    Hi. I added an user's query in SAP BO using the Query Generator (but typing it myself). I used Left and Right Joins in the FROM clasue and a variable ( '[%0]' ) to select results in the WHERE clause. The variable in WHERE clause raises an error. I tr

  • CCMS alert for Bckground Job

    Dear Experts,                     I need to configure mail alert through solman for failed backgrougnd job in R/3 system. Please can anyone share configuration guide. Regards, Sampath

  • Shutting down Macbook air

    HI my new macbook air is shutting down randomly and without notice. is this something from within the computer? or do i have a virus? i just dont know what could be causing this and its new so im kinda freaking out.

  • I can't access my programs but subscription is still active

    My Cloud subscription has until April. I was using the programs earlier this week and now I cannot open them. I get a screen telling me to renew my subscription, but I still have 3 months left! My account shows that Adobe Creative Cloud is still acti