x
login about faq Site discussion (meta-askssc)

How to separate coma delimited values

HI,

I am having a string variable. Where the values are delimited. For example: String sample='a,b,c,d,e'

How to split this string into mutiple values and pass it to an arry?

Regards BI DWH BALA

more ▼

asked Nov 26 '09 at 05:10 PM in Default

BI DWH BALA gravatar image

BI DWH BALA
606 28 40 51

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Hi,

I found a link, where it is explained very well.

Click Here

Regards BI DWH BALA

more ▼

answered Nov 30 '09 at 01:55 PM

BI DWH BALA gravatar image

BI DWH BALA
606 28 40 51

(comments are locked)
10|1200 characters needed characters left

with strings as (select 'a;b;c;d;e;f' str , ';' sep from dual) select regexp_substr ( str , '[^' || sep || ']+' , 1 , level ) word from strings connect by level <= (length ( str ) - length ( replace ( str , sep ) )) / length ( sep ) + 1;

more ▼

answered Jun 29 '10 at 04:18 AM

arnaud gravatar image

arnaud
1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x50

asked: Nov 26 '09 at 05:10 PM

Seen: 534 times

Last Updated: Nov 26 '09 at 05:10 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.