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!

Mask data regexp_replace

Sid_ Z.Mar 21 2016 — edited Mar 21 2016

Hi All,

I need to mask the character and numeric data of the columns to some 'x' say. I did it following but I got the ora-1722 invalid number error:

create table t1

( c1 number,

  c2 varchar2

);

insert into t1 values (12345, 'This is a test') ;

insert into t1 values (45.69,'Hi');

update table t1

set c1 = regexp_replace(c1,'[A-Za-z0-9]','x'),

      c2 = regexp_replace(c1,'[A-Za-z0-9]','x');


My requirement is my table should be updated as

for column id should be - xxxxx, xxxx xx x xxxx

for column id should be - xx.xx,xx


Regards,

Sid

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2016
Added on Mar 21 2016
4 comments
678 views