How to change partial column value in a table

in Oracle Database; I want to change the partial value of a column in a table using SQLPLUS. For example, I want to ...
+ Post Reply + Post New Topic
Results 1 to 3 of 3
  1. #1
    Veetri is offline Junior Member
    Points: 50, Level: 1
    Join Date
    08 Jan 2010
    Posts
    2
    Points
    50

    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. #2
    nukala ramji is offline Junior Member
    Points: 10, Level: 1
    Join Date
    08 Jan 2010
    Location
    hyderabad
    Posts
    1
    Points
    10

    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.

  3. #3
    Veetri is offline Junior Member
    Points: 50, Level: 1
    Join Date
    08 Jan 2010
    Posts
    2
    Points
    50

    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.

Other Solutions
  1. Replies: 2
    Last Post: 09-10-2010, 05:49 PM
  2. how to attach sequence to a column in a table
    By venky359 in forum Oracle Apps Technical
    Replies: 1
    Last Post: 04-26-2010, 08:29 AM
  3. How to get all the column values from a table using table source
    By diwakar.shenoy@gmail.com in forum Oracle Apps Technical
    Replies: 0
    Last Post: 02-01-2010, 02:58 AM
  4. Replies: 8
    Last Post: 12-15-2009, 09:17 AM
  5. Replies: 2
    Last Post: 08-04-2009, 06:25 PM