- 01-08-2010 05:21 PM #1
How to change partial column value in a table I want to change the partial value of a column in a table using SQLPLUS. For example, I want to replace <fname>.<lname>@domain.com to <fname>.<lname>@newdomain.com. I want the sql to go through the table and replace just the domaan part of the email column. Is this possible to do with a sqlplus command? Thanks.
- Club-Oracle Complementary E-Books and Magazines
Get your free Complementary Copy of Oracle Magazine
You can also browse the Free Magazines and E-Books section to see the complete list of free magazines, e-books and Whitepapers.
- 01-08-2010 06:13 PM #2
Re: How to change partial column value in a table hi,
i understood ur query.
the solution for this query is just by using the string functions ,we can achive the goal.
here is the solution for your query....
in above query tab_name --> table nameCode sql:UPDATE tab_name SET email = substr(email,1,instr(email,'@',1,1)-1)||'@ur_newdomain.com'
email ----> column name.
i think it can help u.
do u have doubts in the above query ....feel free to mail me at ramamohan.nukala@gmail.comLast edited by nukala ramji; 01-08-2010 at 06:16 PM.
- 01-08-2010 07:31 PM #3
Re: How to change partial column value in a table Thank you. I did use almost the same command before but had an extra || at the end. Anyway, the command you had worked great. Thanks again.
Similar Threads
-
updation of one column based on two table values reg.
By laxman in forum SQL PL/SQLReplies: 8Last Post: 12-15-2009, 09:17 AM -
Update a table with values from same table AND another table
By makidrin in forum SQL PL/SQLReplies: 2Last Post: 12-08-2009, 06:54 AM -
Change hostname
By mzainal in forum Oracle Fusion MiddlewareReplies: 1Last Post: 09-02-2009, 02:18 PM -
create table with many columns into one column
By sai in forum SQL PL/SQLReplies: 2Last Post: 08-04-2009, 06:25 PM -
Change is Here!
By Sadik in forum AnnouncementsReplies: 5Last Post: 02-23-2009, 02:50 AM


LinkBack URL
About LinkBacks
Reply With Quote
