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

Home -> Community -> Usenet -> c.d.o.tools -> Re: about the REPLACE function in PL/SQl:newbie here

Re: about the REPLACE function in PL/SQl:newbie here

From: <xmark.powell_at_eds.com.x>
Date: 22 Mar 2001 16:34:29 GMT
Message-ID: <99d9il$dov$1@news.netmar.com>

In article <3AB7ED7E.6C4E31AD_at_hotmail.com>, srcnckpc <@hotmail.com> writes:
>Hello:
>
>I am trying to create a PL/SQL block to select ename into a PL/SQL
>variable.
>In the PL/SQL variable I have to replace every I or i with a *.
>
>How can I do this?
>
>I know the syntax is: SELECT REPLACE ('YYY', 'YY', 'P') from table_name.
>
>But I don't know to code this in the BEGIN block, ie,
>
>DECLARE
> v_name emp.ename%TYPE;
>BEGIN
> SELECT ename
> FROM emp
> INTO v_name;
>
> SELECT REPLACE ??????
>
>END;
>
>Thanks so much for any clues.
>

select replace(ename,'I','i')
into v_name
from emp;

OR in pl.sql v_name := replace(v_name,'I','i');

You might also be interested in the translate function.

Received on Thu Mar 22 2001 - 10:34:29 CST

Original text of this message

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