Reputation: 3
if there is a name column
name
prashant
ram
then the column values should become like this name
##############################
# Name | Replaced_value #
##############################
# prashant | XXXXXXXX #
# | #
# ram | XXX #
##############################
It has to replaced by same number of Xs.
Upvotes: 0
Views: 303
Reputation: 2278
This will work !!
select name,substr(lpad(name,length(name)+length(name),'X'),1,length(name)) as replaced_name from table
Upvotes: 0
Reputation: 726
You can combine lpad/rpad and length
LPAD('X',LENGTH(InputString),'X')
Upvotes: 3