• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Passing a string in an IN operator in oracle

 
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
 
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
 
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
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic