Insert table into existing Oracle column

1153270 pts.
Tags:
Oracle
Oracle Database
I noticed that whenever I try to add an existing to an existing column in Oracle, it's always down at the end of the table. Is there an Oracle command where I can tell it to put it in the table? Thank you.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

There is no way to “insert” new columns in the middle of the table.  If you really want to do that, you would need to

  • Backup the information currently in your table.
  • Drop the columns that are after the position where you want to new one.
  • Add the new column.
  • Add the other columns you dropped.
  • Insert the data for the columns that were dropped from the backup.

You could also drop the whole table (after backing it up) and re-create it with the new structure, and then re-insert the data.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • CharlieBrowne
    Adding all new data columns to the end of the record is BEST PRACTICES. Inserting or removing columns from the center of a record should not be done if possible
    62,385 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: