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: String split

Re: String split

From: Roman Mirzaitov <rmirzaitov_at_kt.kg>
Date: Thu, 29 Nov 2001 13:56:36 GMT
Message-ID: <o8rN7.42165$xS6.70670@www.newsranger.com>


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.com
Received on Thu Nov 29 2001 - 07:56:36 CST

Original text of this message

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