Re: splitting a string into columns
From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 01 May 2008 18:21:34 -0700
Message-ID: <1209691291.940288@bubbleator.drizzle.com>
Date: Thu, 01 May 2008 18:21:34 -0700
Message-ID: <1209691291.940288@bubbleator.drizzle.com>
kes wrote:
> I'm working with Oracle 10g R2
>
> create table table1(
> table1_id number,
> csv1 varchar2(100),
> csv2 varchar2(100));
>
> insert into table1 values(1, 'a,b,c', 'w,x,y,z');
> insert into table1 values(2, 'a,b,c,d', 'x,y,z');
>
> select * from table1;
> "TABLE1_ID","CSV1","CSV2"
> "1","a,b,c","w,x,y,z"
> "2","a,b,c,d","x,y,z"
>
>
> I would like to see it like
> 1, a, b, c, , w, x, y, z
> 2, a, b, c, d, , x, y z
>
>
> Should I create a store procedure that will split the strings into
> different rows, then pivot them? Are there any good articles to point
> to a better way? Any suggestions will be welcomed.
>
> Alex
Why does this require a stored procedure and where's the pivot?
-- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu May 01 2008 - 20:21:34 CDT