Home » SQL & PL/SQL » SQL & PL/SQL » Passing strings to cursors
Passing strings to cursors [message #37743] Tue, 26 February 2002 05:29 Go to next message
Brian Kelly
Messages: 4
Registered: February 2002
Junior Member
Hi All,
Lets take the following example:

where project_id = v_where_clause;

v_where_clause holds ('1111'), the cursor works fine.

now look at this:

where project_id in (v_where_clause);

this time v_where_clause holds ('1111','2222')the cursor fails with no data found.

Can someone please tell me if there is a way of getting a string of values in all at once rather than using a loop to put them in one by one as this is taking to long

thanks
Brian
Re: Passing strings to cursors [message #37747 is a reply to message #37743] Tue, 26 February 2002 07:56 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You won't be able to use a variable in the IN list with static code. One option is to use dynamic SQL (build the statement string on the fly) and another is to use object types as described here:

http://asktom.oracle.com/pls/ask/f?p=4950:8:540108::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:110612348061,
Previous Topic: Re: How do i populate a LOV with values from a cursor?
Next Topic: dynamic sql
Goto Forum:
  


Current Time: Tue Apr 16 05:45:05 CDT 2024