Home » SQL & PL/SQL » SQL & PL/SQL » Convert CSV string of numbers (Oracle 9i)
Convert CSV string of numbers [message #409895] Wed, 24 June 2009 06:57 Go to next message
abis123
Messages: 31
Registered: February 2007
Member
I have a string of numbers in a comma separated value, is it possible to convert this to a comma separated value of integers.

I am using an IN statement (which can be seen below) and it checks to see if an integer is in a CSV, the problem is that the CSV is stored as a string. What I want to do is convert this string to a CSV of integers but this wont happen with a simple TO_NUMBER. Is there any way of achieving this? Many thanks in advance.

SQL:
WHERE 2 IN ECM \\(ECM being a CSV of number e.g. '2,4,7')
Re: Convert CSV string of numbers [message #409907 is a reply to message #409895] Wed, 24 June 2009 07:14 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Search for "varying inlist" or the like.

Regards
Michel
Re: Convert CSV string of numbers [message #409910 is a reply to message #409907] Wed, 24 June 2009 07:19 Go to previous message
abis123
Messages: 31
Registered: February 2007
Member
Thanks very much. It would seem you get asked this a lot, I do apologise, just didn't know the terminology. Cheers again.
Previous Topic: BFILE,LOB
Next Topic: Select within a select?
Goto Forum:
  


Current Time: Thu Dec 05 13:57:23 CST 2024