Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> DROP or MODIFY COLUMN on Oracle 8 system

DROP or MODIFY COLUMN on Oracle 8 system

From: Alexander Mueller <millerax_at_hotmail.com>
Date: Fri, 12 May 2006 12:24:31 +0200
Message-ID: <44646260$0$11063$9b4e6d93@newsread4.arcor-online.net>


Hi

I need to change the datatype of a column from VARCHAR2 to FLOAT preserving all data, which actually represent numeric data. I have to do it on an oracle8 enterprise system. Afaik

        ALTER TABLE tablename DROP COLUMN column and / or

        ALTER TABLE tablename MODIFY (column <NEW_DATATYPE>) doesn't work here, is that correct?

So my migration plan is as follows:

  1. create a temporary table with same schema as the src-table (except for the changed datatype of the one column)
  2. insert / copy all old data into the new table problem: how will i keep values of auto-incremental fields?
  3. Drop old table problem: how can i drop it, when its PK has references?
  4. Re-create old table, with correct datatype for the one column
  5. insert / copy data from tmp-table. problem: same as in 2.
  6. drop temp-table

Can anybody please help me on how to solve the problems mentioned. Or is there a better strategy (maybe built-in management tools?)

Thanks,
Alex Received on Fri May 12 2006 - 05:24:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US