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

Home -> Community -> Usenet -> c.d.o.server -> Re: an IN clause with a bind variable

Re: an IN clause with a bind variable

From: Kevin P. Fleming <kfleming_at_access-laserpress.com>
Date: Thu, 27 Aug 1998 00:55:35 GMT
Message-ID: <b82F1.2820$435.7344888@news.rdc1.az.home.com>


Then I'd say your best best is to move the SELECT statement into a stored procedure that takes the bind variable as a parameter and returns a cursor to the result. The net effect on your application shouldn't be too drastic, other than the actual SELECT statement is no longer in your code...

Scott Patterson wrote in message <35e40965.0_at_feed1.realtime.net>...
>Dynamic SQL functions but has to reparse and plan every statement. I am
>trying to take advanatage of bind variable statements not being reparsed.
>This works great with all the other statements. I just have not found a
>good way to utilize this feature with the IN clause.
>
>Scott
>
>
>Kevin P. Fleming wrote in message ...
>>You can't do it this way; you'll have to just build the SQL string
>>dynamically instead of using a prepared statement approach.
>>
>>Scott Patterson wrote in message <35e31038.0_at_feed1.realtime.net>...
>>>What is the trick to using a bind variable with an IN clause?
>>>
>>>If I assign 3, 5, 7, 10 to :1 and parse the following statement is parses
>>>correctly but give the error ORA-01722 (invalid number) upon execution.
>>>
>>>SELECT col1 FROM table1 where col1 IN (:1);
>>>
>>>All the other SQL statements are working fine. It is only failing when
>>>there is an IN clause.
>>>
>>>Thanks,
>>>
>>>Scott
>>>
>>>Details:
>>>C program making OCI calls
>>>Oracle 7.3.4
>>>DEC Unix
>>>
>>>
>>>
>>
>
>
Received on Wed Aug 26 1998 - 19:55:35 CDT

Original text of this message

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