I'm finalizing a HUGE group Oracle project and noticed some of my fellow developers created some of their tables using non-standard data definitions when they created their tables. Since allot of data has been entered in these tables, simply dropping and recreating them is not an option. So, I'm trying to find the easiest way to correct it.
Problem:
One of our control fields, ROW_ID, is defined as VARCHAR2(28), when it should be NUMBER(38).
Solution 1?:
Can I simply issue an alter table statement to change this, but be sure the data is the same? All data in this column is numeric, but I'm assuming no...
Solution 2:
My other plan is to create a script (one each for the 40 tables in 22 seperate DBs, so 880 total) that would:
Drop the index
Insert a ROW_ID_TEMP NUMBER(38) column
Set this column = ROW_ID
Drop the ROW_ID column
Create a new ROW_ID NUMBER(38) column
Set the ROW_ID column = ROW_ID_TEMP
Drop ROW_ID_TEMP
Recreate Index
Before I go through all this effort, does anyone have a better approach?
Thanks!
Doug
Problem:
One of our control fields, ROW_ID, is defined as VARCHAR2(28), when it should be NUMBER(38).
Solution 1?:
Can I simply issue an alter table statement to change this, but be sure the data is the same? All data in this column is numeric, but I'm assuming no...
Solution 2:
My other plan is to create a script (one each for the 40 tables in 22 seperate DBs, so 880 total) that would:
Drop the index
Insert a ROW_ID_TEMP NUMBER(38) column
Set this column = ROW_ID
Drop the ROW_ID column
Create a new ROW_ID NUMBER(38) column
Set the ROW_ID column = ROW_ID_TEMP
Drop ROW_ID_TEMP
Recreate Index
Before I go through all this effort, does anyone have a better approach?
Thanks!
Doug