Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help : PL/SQL Cursor Limitations

Re: Help : PL/SQL Cursor Limitations

From: Brad Worsfold <bworsfold_at_vic.lgs.ca>
Date: 1997/07/22
Message-ID: <01bc967c$5d926e80$0faf22cf@cerulean>#1/1

> /* Cursor Declaration */
>
> Cursor Employee is
> select Emp_Name
> from Employee
> where Emp_id in (:global.string);
>
>
> /* Explanation */
>
> :global.string := '12,23,54,65' ;
>
> I am trying to use IN operator to compare
> Emp_id against a set of values. This query Treates the set
> (:global.string)
> as a single value and returns nothing.
That is correct. The compiler would interpret it as

    where Emp_id in ('12,23,54,65').

It should be of the format

        where emp_id in ('12','13','54','65');

I don't think you can do this using one variable as the variable would be treated as one value. You could do it via Dynamic SQL and cursors and build the in clause to accomplish what you want.

Good luck.

Brad

> If I initialize :global.string := '12' then the query runs fine.
>
> What's the Problem with this Cursor Declaration ?
> by the way I am working in Forms 4.5
>
> Thanks in advance.
>
Received on Tue Jul 22 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US