Re: splitting a string into columns

From: Ed Prochak <edprochak_at_gmail.com>
Date: Fri, 2 May 2008 05:19:04 -0700 (PDT)
Message-ID: <97fc16c0-b609-4ccf-8104-1e02dbe01489@c58g2000hsc.googlegroups.com>


On May 1, 7:55 pm, kes <abi..._at_gmail.com> 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

It looks like all you are asking for is to change the column separator Check into the SET command if that is the case.   Ed Received on Fri May 02 2008 - 07:19:04 CDT

Original text of this message