Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: string process in PL/SQL
Hi,
look at INSTR and SUBSTR SQL functions.
Details in Oracle SQL Reference.
Regards,
-- Roman Mirzaitov Brainbench MVP for Oracle Administration www.brainbench.com "charlie s" <cs3526(delete this word)@yahoo.com> wrote in message news:G8Rr9.30842$nb.16028_at_nwrddc02.gnilink.net...Received on Fri Oct 18 2002 - 05:45:49 CDT
> In one of our PL/SQL code, it looks like this
>
> CURSOR sql_pieces_cur
> IS
> SELECT sql_text
> FROM v\$sqltext
> WHERE address = addr_IN
> AND hash_value = hash_IN
> ORDER BY piece ASC;
> FOR sql_pieces_rec IN sql_pieces_cur
> LOOP
> .................
>
> Most of the time, sql_pieces_rec contains sql statement like
> "select col1 from A"
> But sometimes, it contains comments in it and it will cause error in our
> application.
> "select --this statement is for training purpost-- col1 from A"
> How could I process sql_pieces_rec to remove all the comments starting
from
> "--" ending "--"
> so my sql_pieces_rec will always look like
> "select col1 from A"
>
> Thanks you very much for your help.
>
>
>
>