Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL: parsing csv string and return it as rowset
joes wrote:
> Hello there
>
> I have currently in a table csv concateneted strings. Now I got the
> beautiful task to build reports on it, but for this I have first to
> splitt those in their respetive tokens and build tables on it.
>
> So my first idea is to do this at the fly. Means building a view on
> this which uses a PL/SQL function for the parsing of the strings.
>
> Unfortunately I have to use Oracle 8.1.7. I have seen that Oracle 9
> supports "pipelined" returns of tables, but version 8 does this not.
>
> So I need a little bit more help to get this done. Could you bring me
> up with some good examples and suggestions how I could solve my
> challenge ?
>
> - How to return dynamical arrays from a pl sql funcion ?
> - How to splitt strings into its token with pl /sql ?
> - How to return a "virtual" rowset from pl /sql so that I can execute
> a "select ..." statement on it ?
> - Other suggestions how to achieve this ?
>
> thank you best regards
> Mark
If the individual pieces are 30 bytes or smaller look at the DBMS_UTILITY.COMMA_TO_TABLE built-in package procedure.
Otherwise ... you are about to become very familiar with SUBSTR and INSTR.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Thu Feb 19 2004 - 17:36:50 CST
![]() |
![]() |