Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help : PL/SQL Cursor Limitations
> /* 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