How to loop inside another collection collection.

Hello


Declare
qry varchar2 (100);
type t1 is the table of the varchar2 (1000);
t t1;
type h1 is table of the emp % rowtype;
h h1;
I have pls_integer;
Begin

qry: = 'EMP ';

SELECT COLUMN_NAME BULK COLLECT INTO t OF USER_TAB_COLUMNS WHERE TABLE_NAME LIKE 'EMP ';

/ * Print the column names * /.
because me t.first... loop of t.Last
dbms_output.put_line (t (i)); --> The names column print
end loop;

SELECT * COLLECT LOOSE hours of EMP;

/ * Print the content * /.
j in h.first... loop of h.Last
dbms_output.put_line (h (j) (i) .t); -> Here I try different values to print all the column values, if we use
end loop; dbms_output.put_line (h (j) .empno); It prints instead of who uses different
end;


In the above block if I use t (i) it shows that T must be declared please suggest me how to use the t (i) inside the loop to print the column names


Thank you
Sudhir

Why the postal code again?

By the way - DBMS_OUTPUT does not print anything. He is unable to do so. This is an internal buffer in PL/SQL and very expensive PGA memory consumption.

Your approach and your code are flawed. If you want to dynamically reference a cursor column names, use DBMS_SQL.

But, making reference to a dynamic column makes no sense you have STATIC code and by that it means that the projection of SQL is known. The columns inside this projection is known. The data types of the columns inside the projection is known.

This is why I said - define the problem.

What you did is displayed code broken for a wrong approach. And as you have discovered yourself, the code does not work. Then take a step back and describe the problem that the code is supposed to address.

If we have a clear definition of the problem, we can discuss solutions for it.

At the moment - you posted a solution imperfect and broken. And there is not much to discuss, but to say that she is wrong and will not work.

Tags: Database

Similar Questions

  • declareing cursor for loop inside another cursor for loop

    Hi friends,

    Is it possible declareing cursor loop within another cursor for loop for.

    Please guide for example?

    You can even declare cursor within the cursor loop

    declare
    cursor c1 is select deptno from the Department;
    BEGIN
    for cr1 in c1
    loop
    declare
    cursor c2 is select ename from emp where deptno = cr1.deptno;
    Start
    for cr2 in c2
    loop
    dbms_output.put_line (CR1. DEPTNO | ' ' || CR2.ename);
    end loop;
    end;
    end loop;
    end;

  • How to move photos from one Collection to another Collection

    Some, while the rear I hung some pictures from one Collection to another Collection.

    Later, I noticed that I had lost the ability to edit images moved.

    Please explain how can I move photos between Collections without causing problems?

    Cliff

    However, I can't figure out how to move photos from a private Collection to another more appropriate called Collection. I had thought that drag would do the trick. But I was wrong.

    Well, I think it's the right way to do it. Why do you think it's wrong? What is going on? Describe in detail or show a screenshot. State of the edited, complete error messages, Word for Word.

  • How to loop through DataGrid (ArrayCollection, DataProvider collection)

    I need to loop through a collection ArrayCollection DataProvider or DataGrid (not sure which is best) so that I can insert information in a database through ColdFusion.

    The data grid has three columns: ID, item and quantity.  I have a table that contains these same fields.  The DataGrid control is pre-filled with a list of items.  The user can then enter the quantity of items in the DataGrid.  I then want to store this information in my table.  In ColdFusion, I would accomplish this through CFLOOP, however, in Flex I want to loop through the data grid so that I can get all the items and the quantities that the user has updated.

    I guess I have to do a loop in ActionScript, but I don't know how to do that.  Can anyone provide a suggestion and example code?

    Thanks again!

    Lee

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

    Here ya go:



    http://www.Adobe.com/2006/mxml '.
    creationComplete = "init (); » >
     
        Import mx.collections.ArrayCollection;
         
    public void init (): void {}
    var ac:ArrayCollection = new ArrayCollection([)
    {Field1: "my one - item a field", Field2: "my field two - point one"},
    {Field1: "my field one - point two", Field2: "my field two - point two"},
    {Field1: "my one - three field element", Field2: "my field two - point three"},
    ]);
    for each {(var point: Object en ac)}
    for each {(var: objet field àle point)}
    trace (Field);
    }
    }
    }
    ]]>
     

  • mutiset separate union inside the collection

    
    DROP TYPE list_number;
    /
    
    DROP TYPE t_number;
    /
    
    CREATE OR REPLACE TYPE t_number IS OBJECT (a NUMBER);
    /
    
    CREATE OR REPLACE TYPE list_number IS TABLE OF t_number;
    /
    
    -- this code doesnt raise exception
    DECLARE
       w    list_number := list_number (t_number (1), t_number (2));
       w1   list_number := list_number (t_number (1), t_number (2));
       w2   list_number;
    BEGIN
       w2 := w MULTISET UNION  w2;
    END;
    /
    
    -- this code  raise exception when using distinct inside multiset with user defined collection
    --ORA-06550: line 6, column 10:
    --PLS-00306: wrong number or types of arguments in call to 'MULTISET_UNION_DISTINCT'
    DECLARE
       w    list_number := list_number (t_number (1), t_number (2));
       w1   list_number := list_number (t_number (1), t_number (2));
       w2   list_number;
    BEGIN
       w2 := w MULTISET UNION distinct w2;
    END;
    /
    
    -- this dosent raise exception when using distinct inside multiset 
    DECLARE
       TYPE list_num IS TABLE OF NUMBER;
    
       w    list_num := list_num (1, 2);
       w1   list_num := list_num (2, 2);
       w2   list_NUM;
    BEGIN
       w2 := w MULTISET UNION distinct  w2;
    END;
    /
    

    Hi gurus,

    When you use separate inside a collection of type multiset for schema-owned type exception is thrown for which I am unable to find the root cause

    Version

    11.2.0.3.0 Production NLSRTL

    Oracle Database 11g Enterprise Edition 11.2.0.3.0 64 bit Production

    PL/SQL 11.2.0.3.0 Production

    AMT for Linux: 11.2.0.3.0 Production

    SEPARATE means by comparing and throws exception since it does not know how to compare objects of type T_NUMBER. The map method, you must:

    SQL > CREATE OR REPLACE
    T_number TYPE 2
    3. IS ITEM)
    4 a certain NUMBER.
    5 FUNCTION of MEMBER card compare the RETURN NUMBER
    6              );
    7.

    Type of creation.

    SQL > CREATE OR REPLACE
    2 BODY of TYPE t_number
    3 EAST
    4 MEMBER card FUNCTION compare the RETURN NUMBER
    5 EAST
    6 BEGIN
    RETURN 7;
    8 END;
    9 END;
    10.

    Type the body created.

    SQL >
    SQL > CREATE or REPLACE TYPE list_number IS TABLE OF THE t_number;
    2.

    Type of creation.

    SQL > DECLARE
    2 w list_number: = list_number (t_number (1), t_number (2));
    3 w1 list_number: = list_number (t_number (1), t_number (2));
    W2 4 list_number;
    5 BEGIN
    6 w2: MULTISET UNION w2 w = separate;
    7 END;
    8.

    PL/SQL procedure successfully completed.

    SQL >

    SY.

  • How can I migrate CS6 Collections CC?

    How can I migrate CS6 Collections CC?

    Never mind.  I finally found an answer that works with another search from Google.

  • Help!  How to upgrade two dimension collection ArrayCollection?

    Hello

    I'm having a problem of understanding of documentation on populating a DataGrid of two dimension collection ArrayCollection. My situation is that I have a DataGrid with a bunch of information, currently stored in a two-dimensional array (digital in the first dimension and by field name in the second dimension). I also have a bunch of data streaming from an XMLSocket, which, when it happens, is analyzed, resulting in one of the fields of the table in need of update. I can do very well with the table directly, but I can't try to understand how use the ArrayCollection collection features to cross this two-dimensional structure - setItemAt() does not seem suited for this purpose? I need to trigger the effects on the relevant cell that has been updated, when I round coding, so I will try to use some structure that handles update events and others for me automatically, such as the ArrayCollection collection.

    I do not know is still the best technique to use, and the intermediate level (the ArrayCollection collection and others) could be changed completely, so if you can suggest (and illustrate, if she is as confused as this!) a better method, I would be grateful.

    Thank you

    David

    Ah.

    You must look for the item in the collection ArrayCollection. This is usually done with a loop in the collection. When you have found the item you would:

    Item.Quantity = new quantity;
    dp.itemUpdated (item);

    You must call the method of collection itemUpdated to make the signal Collection all interested parties (for example, the DataGrid bound to her) she's changed.

    A Collection can also views and ViewCursors that might be useful to have a lot of data.

  • How to load my cd collection from my windows computer to my nano?

    I just bought an ipod nano. I am very new to this. How to load my cd collection from my windows computer to my nano? Thanx

    < re-titled by host >

    Import iTunes library, click hereand follow the instructions.

    (142174)

  • How to have a while loop inside a structure of matter?

    Hi all

    I would like to know how to control a while loop by using the structure of the case? I would like the person to check if the object has is in its original position or not.

    If this is the case, go...

    The object must then do its job, as mentioned in the while loop... as up and down 10blocks...

    Later, when she returns to its original position, the entire process must stop...

    I checked the forums on this http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loops-inside-a-case-structure/m-p/591259

    It is the closest, I can have... but can someone tell me how to program for this? How logic should be?


  • Hi, I have a question, I m interested in buying cc for oligo, but I didn't how will look at payment collected monthly from my account. I m from Poland, is if there is any conversion related to the collection to the monthly fee? Exceeds one

    Hi, I have a question, I m interested in buying cc for oligo, but I didn't how will look at payment collected monthly from my account. I m from Poland, is if there is any conversion related to the collection to the monthly fee? Is beyond the $ 19.99 euros will be ordered to pay the money transfer from zlotys to the euro.

    Hello

    In order to know the payment process, you can contact Adobe support:

    https://helpx.Adobe.com/contact.html?step=CCSN

    To know the offers and different plans, you can visit the Adobe Web site:

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Let us know if you need more information.

  • How to buy adobe cs6 collection?

    How to buy adobe cs6 collection?

    Creative cloud now includes the features of Creative Suite Master Collection and Design Premium

  • How to locate the hidden collections that are targeted?

    Hi guys,.

    Sometimes, after setting a collection as a set of targets, I forget to change the setting back to normal - especially if it is hidden inside a collection.

    Is there something, when I turn on LR, to let me know if a targeted collection hides breast and must be restored to its default value?

    Thank you very much

    Raphael

    Nothing obvious to you say that.

    The (non-obvious) answer is that if you go to the Photo Menu and the first point is "Add to quick Collection", then you have not selected a target collection. If the first element is 'Add to the target Collection', then you have defined a target collection.

  • Is there a way to link an article to another collection?

    I would like to link an article to another collection.  Is this possible?

    Currently, we do not support links to collections. You can link to the first collection in the collection of top-level ('House') using goto://ApplicationViewState/library.

    Neil

  • Move a file in a Collection to another Collection

    By mistake, I created a collection when that a file has been highlighted.  I did another collection with all the other files I wanted in it, but I can't just drag a single file of the film...

    There must be another way!

    Looks like the image is also in the second collection, did you.  Check and see.  Lightroom will not move an image from one collection to another if it is already in the collection.  Which is a great feature.  Stops duplicate you images inadvertently.

  • To loop through a collection arrayCollection

    I need to:

    1 loop through a collection of table,

    2. Select a specific string in this collection

    3 extract a url this string

    4. Insert an additional string to the table with that extracted url

    The code I use to date is:

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"minWidth ="1024"minHeight ="768"> "
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;
    Import mx.rpc.events.ResultEvent;

    [Bindable]
    private var resultArrayCollection:ArrayCollection;

    private void doSearch (e:MouseEvent): void
    {
    twitterSearch.url = " " http://search.Twitter.com/search.atom?q=LDN ";
    twitterSearch.send ();
    }

    private function onResult (e:ResultEvent): void
    {
    resultArrayCollection = e.result.feed.entry as ArrayCollection collection;
    }

    []] >
    < / mx:Script >

    < mx:HTTPService id = "twitterSearch.
    result = "OnResult (Event)" / > "

    .....


    the HTTP service pulls in data from Twitter for example search http://search.Twitter.com/search.atom?q=LDN .

    Any help would be received with gratitude.

    Please remove the quotes-"[count].

    for(var count:int = 0; count < resultArrayCollection.length; count++) {
         trace(resultArrayCollection[count].title);
    }
    

Maybe you are looking for