Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: inserting comma-separated values with pl/sql
"Christoph Seidel" <Christoph.Seidel1_at_gmx.de> wrote in message news:<b35vdh$1j53eo$1_at_ID-143718.news.dfncis.de>...
> Hi there,
>
> i have a stored proc which has a varchar parameter which contains a list of
> values, separated by comma.
>
> e.g.: 123,456,789
>
> what i wanna do is to separate the values and insert them into a table
>
> e.g.
>
> insert into t (f) values (123);
> insert into t (f) values (456);
> insert into t (f) values (789);
>
> Can this be done with pl/sql? And if i can be done, how?
Yes. You have to tokenize your string and loop thru it.
I replied to another post with code example with somewhat similar
situation. Check it at
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=92eeeff0.0301311708.71563b53%40posting.google.com
Regards
/Rauf Sarwar
Received on Fri Feb 21 2003 - 19:30:31 CST