Results 1 to 3 of 3

Thread: How to rectify this using a single update query

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Answers
    3

    How to rectify this using a single update query

    Suppose i have a table emp with following field name firstname, lastname, salary, age and dept. there is a mistake made while typing names inplace of firstname lastname has been filled and inplace of lastname firstname has been filled. How can we rectify this using a single update query.


  2. #2
    Expert Member
    Join Date
    Sep 2006
    Answers
    130

    Re: How to rectify this using a single update query

    Hi pjitu,

    The column name can be renamed using ALTER TABLE command as follows,
    ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name ;
    But only a single column can be renamed in a single ALTER TABLE command & if we try to rename more than column name, then ORA-23290 error will be encountered.
    ORA-23290: This operation may not be combined with any other operation
    Cause: ALTER TABLE RENAME COLUMN/CONSTRAINT operation was given in conjunction with another ALTER TBALE Operation. This is not allowed.
    Action: Ensure that RENAME COLUMN/CONSTRAINT is the only operation specified in the ALTER TABLE.

    So the column renaming has to be done using more than one ALTER TABLE command.

    Last edited by Innila; 02-27-2007 at 01:26 AM. Reason: SQL Query Formatting
    *** Innila ***

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Answers
    3

    Re: How to rectify this using a single update query

    Thanks a ton


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact