<< Click to Display Table of Contents >>

Rename Column

Top Previous Next

While Oracle Server Version 8.1.5 or later (Oracle 8i) supports dropping columns, there is still no support for renaming a column. You must create a new table structure with the new column name, and copy the data manually. All constraints, comments and triggers should be re-created on the new structure. Hora automates this procedure in Oracle 7 and 8.0.

The dialog requests the following options:

New column name.

The data from the original table is saved in a temporary table. You can change the default HORA_TEMPORARY to any other valid identifier.

Perform the operation (yes/no). If this option is checked, Hora lets you create a script only.

Commit each insert option. When copying significant amounts of data, you can prevent rollback segment problems by adding a commit after each insert operation.

Disable constraints. If checked, Hora does not enable constraints after the column has been dropped. You will then need to do this manually.

Save script to file. You can enter a valid file name. Hora lets you create a script only if the perform option is not checked.

The combination of these checkable options allow you to choose between

Performing the operation immediately on your database (this is irreversible, but you can watch the procedure if the Extras | SQL Preview menu item has been checked.),

Generating a SQL script file only or

Doing both.

First all constraints, indexes, triggers and privileges owned or referenced by the table are dropped. These will be re-created later if possible. The table's rows are saved in the temporary table that you have specified in this dialog. Then the rows are copied back from the temporary table.

PL/SQL objects and views will not be updated by the procedure. Please check them manually for errors after the procedure has been completed.

Although the process is very safe, we recommend that you back up your database completely before performing the operation in order to avoid loss of data in the even of a system crash or other unexpected circumstances.