Home » SQL & PL/SQL » SQL & PL/SQL » String manipulation
String manipulation [message #664246] Mon, 10 July 2017 02:00 Go to next message
praf1981
Messages: 3
Registered: July 2017
Junior Member
Hi Team,

I want show the output of 'Praful' as 'P****l'.

I can do this by using below query:

select substr('Praful',1,1) || LPAD('*', length('Praful')-2,'*') || substr('Praful',-1,1)
from dual;

but is there any simple way to do it?
Re: String manipulation [message #664247 is a reply to message #664246] Mon, 10 July 2017 03:19 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

I don't know what you mean "simple way" (I think this one is simple) but this is most likely the fastest one.

Re: String manipulation [message #664248 is a reply to message #664246] Mon, 10 July 2017 03:49 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
If you have the Advanced Security Option available, you can use the Data Redaction facility to write the string according to circumstances. Being a declarative technique, you won't have to anything programmatically.
Re: String manipulation [message #664675 is a reply to message #664248] Thu, 27 July 2017 05:57 Go to previous message
praf1981
Messages: 3
Registered: July 2017
Junior Member
Thanks for the reply Michel,John
Previous Topic: PLS-00201: identifier 'UTL_MAIL' must be declared
Next Topic: Help with sql code
Goto Forum:
  


Current Time: Fri Mar 29 05:31:08 CDT 2024