Home » SQL & PL/SQL » SQL & PL/SQL » CONVERSION.
CONVERSION. [message #21745] Tue, 27 August 2002 08:52 Go to next message
masoom
Messages: 2
Registered: November 2001
Junior Member
hello experts!
actually i want to see my data from THE ENAME OF 'emp' as the first 'A' from emp coverts as 'X' and the second ename from the emp converts as 'XX'. for example
ename converted_value
ADAMS XDXXMS
ALLEN XLLEN
MARTIN MXRTIN.
IT IS VERY URGEN PLS HELP ME.
BEST REGARDS
MASOOM.
Re: CONVERSION. [message #21751 is a reply to message #21745] Tue, 27 August 2002 22:34 Go to previous message
Raj
Messages: 411
Registered: November 1998
Senior Member
hi,
the following query solves u'r problem if u have character 'A' upto second occurence in ename column.

select replace(decode(nvl(substr(ename,1,instr(ename,'A',1,2)),'1'),'1',ename,substr(ename,1,instr(ename,'A',1,2)-1)),'A','X')||
replace(substr(ename,decode(instr(ename,'A',1,2),0,null,instr(ename,'A',1,2)),length(ename)),'A','XX') from emp

bye,
raj
Previous Topic: RETURNING CLAUSE
Next Topic: DBMS.UTL_FILE Doubt
Goto Forum:
  


Current Time: Fri Apr 26 19:58:34 CDT 2024