How to rename tables and fields using SQL?

L

Laser Lu

Can tables and fiels be renamed in SQL? How to rename those schema objects
by using DDL?
 
D

Dan Artuso

Hi,
To rename a field, you have to first create a new field with the name you want,
copy all the data from the old field to the new, then drop the old field.

For exact syntax, look up Alter Table in Help. You can use an Update statement to
copy the data.
 
L

Laser Lu

Tank you, Dan!
Then how about rename a table? Create a new table and then copy the data
from the original table into the new table using the SELECT statement?
Right?

And since there is no good solution on SQL, is there any other programable
interfaces for renaming tables and fields?
 
Top