Re: PL/SQL Question - Separating A Delimited String Into temporary Variables

  • From: Connor McDonald <hamcdc@xxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 3 Feb 2005 05:34:42 +0000 (GMT)

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


--- Kevin Bass <kbass@xxxxxxxxxxxxxxx> wrote:

> 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
> --
> //www.freelists.org/webpage/oracle-l
> 


=====
Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
ISBN: 1590592174

web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald@xxxxxxxxx

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"

------------------------------------------------------------


                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 
--
//www.freelists.org/webpage/oracle-l

Other related posts: