+ Reply to Thread + Post New Thread
Results 1 to 3 of 3
  1. #1
    Veetri's Avatar
    Veetri is offline Junior Member
    Join Date
    08 Jan 2010
    Posts
    2
    Say Thanks
    0
    Thanked 0 Times in 0 Posts
    Documents
    0
    Uploads
    0

    Default 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.

  2.    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.

  3. #2
    nukala ramji's Avatar
    nukala ramji is offline Junior Member
    Join Date
    08 Jan 2010
    Location
    hyderabad
    Posts
    1
    Say Thanks
    0
    Thanked 0 Times in 0 Posts
    Documents
    0
    Uploads
    0

    Smile 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....


    Code sql:
    UPDATE tab_name SET email = substr(email,1,instr(email,'@',1,1)-1)||'@ur_newdomain.com'
    in above query tab_name --> table name
    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.com
    Last edited by nukala ramji; 01-08-2010 at 06:16 PM.

  4. #3
    Veetri's Avatar
    Veetri is offline Junior Member
    Join Date
    08 Jan 2010
    Posts
    2
    Say Thanks
    0
    Thanked 0 Times in 0 Posts
    Documents
    0
    Uploads
    0

    Default 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

  1. Replies: 8
    Last Post: 12-15-2009, 09:17 AM
  2. Replies: 2
    Last Post: 12-08-2009, 06:54 AM
  3. Change hostname
    By mzainal in forum Oracle Fusion Middleware
    Replies: 1
    Last Post: 09-02-2009, 02:18 PM
  4. Replies: 2
    Last Post: 08-04-2009, 06:25 PM
  5. Change is Here!
    By Sadik in forum Announcements
    Replies: 5
    Last Post: 02-23-2009, 02:50 AM

Tags for this Thread