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: Comma delimited values into rows

Re: Comma delimited values into rows

From: Serge Rielau <srielau_at_ca.ibm.com>
Date: Wed, 10 May 2006 00:03:15 -0400
Message-ID: <4cd705F14o19gU1@individual.net>


johnv wrote:
> I have this string in a field called 'ID':
>
> 1000,1001,1002,...n
>
> In sql only, how can i write a view that treats the comma as a new row
> so that my result set reads as:
>
> ID
> -------
> 1000
> 1001
> 1002
>

Actually this would be an interesting exercise for SQL <-> XML. Simply replace the ',' with tags. Add a leading and ending tag to the whole beast and you got yourself a sequence. Now turn the XML into a result set.

Cheers
Serge

-- 
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Received on Tue May 09 2006 - 23:03:15 CDT

Original text of this message

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