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

Home -> Community -> Usenet -> c.d.o.server -> Re: Parsing A String and Inserting

Re: Parsing A String and Inserting

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 14 Mar 2005 16:15:04 -0800
Message-ID: <1110845704.351708.314360@g14g2000cwa.googlegroups.com>

E. Scott wrote:
> I have a small table that looks like the following:
>
> TEST_TABLE_1
>
> TXN_ID NUM(9)
> STRINGFIELD VARCHAR2(90)
>
> If TXN_ID is 123 and STRINGFIELD is 333.444.5555.666.
>
> I need a procedure or function that will parse this string and insert
> rows in another table like this:
>
> TEST_TABLE_2
>
> TXN_ID SEQ_NUM NEW_STRING
> 123 1 333
> 123 2 444
> 123 3 5555
> 123 4 666
>
> I know the INSTR Function can be used in some kind of loop but I am
> not sure what combination of functions to use to know when end of
> string is hit or best method for optimization. Could be large volume
> of rows.
>
> Any help appreciated.
>
> Scott

A bit of PLSQL programming and INSTR and SUBSTR can do the job.

You can tidy it up and test it.

Regards
/Rauf Received on Mon Mar 14 2005 - 18:15:04 CST

Original text of this message

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