wood burning stoves*
The moose likes Oracle/OAS and the fly likes Passing a string in an IN operator in oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Passing a string in an IN operator in oracle" Watch "Passing a string in an IN operator in oracle" New topic

Passing a string in an IN operator in oracle

Kans Singh

Joined: May 20, 2008
Posts: 2
Hi All

I want to have a string in an IN condition.I have the below code it does not return any ID.
For Example...

offer_temp_no is varchar2

Waiting for any answer.............

Agador Paloi
Ranch Hand

Joined: Jan 24, 2006
Posts: 118
if offer_temp_no is a number your code wont work. The replace function returns a string, so the in compare wont work in your select. What are you trying to accomplish in your replace?

John Bengler
Ranch Hand

Joined: Feb 12, 2009
Posts: 133
Hi Kans,

I don't know a way to really use such a varchar parameter as an IN criterion, but if performance (the use of indexes) doesn't matter too much here is a workaround:

But I think if the XSTRING_COURSES_IN makes sense your code (and my example,too) won't work, because for a list of course numbers the query SELECT ID into XID FROM OFFER_TEMP .. will return multiple rows..?

Did this help?

It is sorta covered in the JavaRanch Style Guide.
subject: Passing a string in an IN operator in oracle
Similar Threads
What is the use of using EXECUTE IMMEDIATE in Oraccle PL/SQL
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
retrieve data in PL/SQL proc using JDBC in Websphere
Registering IN OUT parameter
Oracle Java Stored Procedures