Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to replace a string with asterisks? This is related to my previous post

RoxyrollersJul 16 2009 — edited Jul 16 2009
I guess I now need to replace the middle segment of what is retrieved with asterisks.

So, the string in the middle '99999988' should be replaced with '********'. I am basically trying to mask the middle sement string. The length of the original string is not known but the first segment is 6 characters and 3 segment is 4 characters. The middle sement can be anywhere between 5 to 10 characters. In the example below, its 8 characters.

Can I use REPLACE or TRANSALE functions in here ?
  select substr('456712999999881234', 1, 6) a,
         substr('456712999999881234', 7, length('456712999999881234') - 10) b,
         substr('456712999999881234', -4) c
  from	 dual;
Thanks
This post has been answered by Frank Kulash on Jul 16 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2009
Added on Jul 16 2009
5 comments
2,913 views