Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Retrieve data from a varchar2(4000) based on a delimiter.
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
![]() |
![]() |