Home » SQL & PL/SQL » SQL & PL/SQL » HOW TO CHANGE PARTICULAR STRING IN A COLUMN
HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225723] Wed, 21 March 2007 02:37 Go to next message
sreesys
Messages: 2
Registered: March 2007
Location: INDIA
Junior Member

I am Having a table named suppliers.

table structure is below


SID number,
SSiteid number,
name varchar2(20),
...

this table have record more than 1000.

In that i want to change the String "&" in the column name "Name" into "AND"

example :

sid ssite id name

1 1 XXX & co
2 2 YYY & traders

here name is to changes as follows

xxx and co
yyy and co.

pls specify me which query will be suitable to update the table content as specified above



Re: HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225733 is a reply to message #225723] Wed, 21 March 2007 03:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

replace

Regards
Michel
Re: HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225734 is a reply to message #225733] Wed, 21 March 2007 03:26 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Nice to see your contributions, Michel. DBA Village down? Very Happy

MHE
Re: HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225735 is a reply to message #225733] Wed, 21 March 2007 03:27 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
insert into srinu1 values ('srinu@pavu');

select * from srinu1

update srinu1 set name=replace(name,'@','and')

thanks
srinu
Re: HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225738 is a reply to message #225734] Wed, 21 March 2007 03:41 Go to previous messageGo to next message
sreesys
Messages: 2
Registered: March 2007
Location: INDIA
Junior Member

Thanks for your Valuable suggestion.

Your suggestion will suit for my problem.


Regard's

Sreekumar
Re: HOW TO CHANGE PARTICULAR STRING IN A COLUMN [message #225739 is a reply to message #225738] Wed, 21 March 2007 03:51 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Sreekumar, don't forget to check out the link Michel added. It is part of the Oracle documentation. A link to the documentation is included in the "Sticky", the tips and tricks topic.

MHE
Previous Topic: how to find top 3 salary of emp table with out using order by clause
Next Topic: is regulare expression the answer? insert escape characters into string
Goto Forum:
  


Current Time: Fri Dec 02 23:23:30 CST 2016

Total time taken to generate the page: 0.12470 seconds