Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: about the REPLACE function in PL/SQl:newbie here
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.
![]() |
![]() |