Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Retrieve data from a varchar2(4000) based on a delimiter.

Re: Retrieve data from a varchar2(4000) based on a delimiter.

From: Markus Stuhlpfarrer <mstuhlpfarrer_at_hollomey.com>
Date: Wed, 01 Aug 2001 15:06:09 GMT
Message-ID: <3B681A5E.3F59A777@hollomey.com>

search for the delimiter with instr and seperate them with substr instr(INSTRING,DELIMITER,OFFSET,NthOccurance) so, if you search for the delimiter "," in the string "12,13,12" the statement would be something like that: instr('12,13,12',',')
if you want the second one:
instr('12,13,12',',',1,2)
this statement returns you the position of the searched delimiter (or whatever you want)

and you can seperate it with substr
substr(INSTRING,OFFSET,LENGTH)

Dermot Mackey wrote:

> Hi guys,
>
> I have a string of 4000 characters which contains data from 20 fields
> seperated by a delimiter. Is there any method in PLSQL that will allow
> me to search this string for the delimiter and therefore allowing me to
> seperate and extract the data in the string into individual variables ?
>
> Many Thanks,
> Dermot
Received on Wed Aug 01 2001 - 10:06:09 CDT

Original text of this message

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