Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing a string in an IN operator in oracle

 
Kans Singh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.............

Kanchan
 
Agador Paloi
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


Cheers,
Agador
 
John Bengler
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

John
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic