-
Junior Member
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.
-
Expert Member
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 ***
-
Junior Member
Re: How to rectify this using a single update query
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules