Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: PL/SQL Question - Separating A Delimited String Into temporary Variables
while instr(v,'-') > 0 loop
x(x.count+1) := substr(v,1,instr(v,'-')-1);
v := substr(v,instr(v,'-')+1);
end loop
or something thereabouts
> Hello:
>
> I am converting my Perl program into an Oracle package but I have run
> into a small problem. I have been successfully except for a minor
> problem. I would like to separate a value of 1-2-3-4-5-6-7 by the dash,
> into seven separate values. The finish product would turn out to be
> something like val1 = 1, val2 = 2, val3 = 4, etc. Is this possible? If
> so, how can I achieve this? Thanks!
>
> Kevin
> --
> http://www.freelists.org/webpage/oracle-l
>
Coming Soon! "Oracle Insight - Tales of the OakTable"
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Feb 03 2005 - 00:37:19 CST