Home » SQL & PL/SQL » SQL & PL/SQL » replace the column value
replace the column value [message #311564] Fri, 04 April 2008 15:47 Go to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

Hi All,
I have a column in a table which contains this kind of data in it, i want to replace this column value with 'XXXXXXX'. Any help would be appreciated.

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_?\`%!@#$^*()<>.,":;- /


Thanks in advance
Re: replace the column value [message #311566 is a reply to message #311564] Fri, 04 April 2008 15:58 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
UPDATE your_table SET
  this_column = 'XXXXXXX';
However, I doubt that the solution is that simple.

So, what's behind the scene?
Re: replace the column value [message #311567 is a reply to message #311564] Fri, 04 April 2008 16:00 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
UPDATE JUNK_TABLE SET MESSY_COL = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

Littlefoot, I was composing mine when you posted yours.

>So, what's behind the scene?
Most likely a homework assignment to use REPLACE or TRANSLATE function.

[Updated on: Fri, 04 April 2008 16:03] by Moderator

Report message to a moderator

Re: replace the column value [message #311569 is a reply to message #311567] Fri, 04 April 2008 16:12 Go to previous messageGo to next message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

I really appreciate you reply.. Hmm i need to include this one in my scripts. I am not sure i can do this one seprately in the production. my scripts look like this ..

insert into table
(col1,
col2,
col3)
select 
col1,
col2,
-- this field need to be harcoded to 'XXXXXX'
from some_table


Any Help would be appreciated
Re: replace the column value [message #311570 is a reply to message #311564] Fri, 04 April 2008 16:21 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
Your INSERT sample does NOT do what you originally posted.
Which specification is correct?

> I am not sure i can do this one seprately in the production
"This"? what is "this"?

> seprately in the production
HUH?
Re: replace the column value [message #311571 is a reply to message #311570] Fri, 04 April 2008 16:25 Go to previous message
qasim845
Messages: 95
Registered: March 2007
Location: Philadelphia
Member

Never mint my Problem got solved..

insert into table
(col1,
col2,
col3
)
select
col1,
col2,
'XXXXX'
from table_2;

This was the easiest thing, i am wondering how come i forgot that.

Any way really appreciated everybody who tried to help me.

Thanks again
Previous Topic: Convert Rows into Columns
Next Topic: Huge Query
Goto Forum:
  


Current Time: Sat Dec 03 04:12:25 CST 2016

Total time taken to generate the page: 0.16248 seconds