Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: String split
In article <ac1562ed.0111290238.42eb1f61_at_posting.google.com>, Rami Huhtala
says...
>
>Hie
>how I can do this:
>
>line = 'cat & dog'
>
>I want split this line to two variables so that & is separator.
>like:
>variable1 = 'cat';
>variable2 = 'dog';
>
>
>Thanks
Hi,
the possible solution is:
Using INSTR you find separator sign ('&' in our case) and get it position in
line.
Then using SUBSTR you extract the first portion of line (from beginning to
position you found before).
And now, also using SUBSTR, you get the second part of line (from & to the EOF).
For exact syntax and parameters see Oracle SQL Reference.
Regards,
-- Roman Mirzaitov Brainbench MVP for Oracle Administration www.brainbench.comReceived on Thu Nov 29 2001 - 07:56:36 CST