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: inserting comma-separated values with pl/sql

Re: inserting comma-separated values with pl/sql

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 21 Feb 2003 13:40:01 -0800
Message-ID: <3E569CB1.786DC077@exesolutions.com>


Christoph Seidel wrote:

> 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?

Kenneth and Karsten's responses are good general methods. If your comma delimited values are no more than 30 characters, DBMS_UTILITY.COMMA_TO_TABLE is far more efficient.

Daniel Morgan Received on Fri Feb 21 2003 - 15:40:01 CST

Original text of this message

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