getting a list of values into a collection thru a

oracle India
  • 15 years ago

    Hi,


    Its urgent,


    I have to initialize a collection variable and the initial values are to be got from a query.


    See the below code


    declare
    type acd is table of varchar2(50);
    t1 acd:=acd('asset1','asset2','asset3','asset4','asset5');
    i number;
    k number;
    j acd:=acd('asset1','asset2','asset3');
    begin
    for i in 1 .. 5 loop
    for k in 1..3 loop
    if j(k)=t1(i) then
    dbmsoutput.putline(j(k));
    end if;
    end loop;
    end loop;
    end;




    I have a variable acd of type table.
    I have two variables t1, j of type acd.


    The initial values of t1 are known.
    The initial values of j need to be got dynamically from a select query.


    The following error comes up when we run the above query with a select statement


    PLS-00642: local collection types not allowed in SQL statements



    Is there any solution to this problem.?



    TIA
    Udaya

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Memory is like an orgasm. It's a lot better if you don't have to fake it.” - Seymour Cray