
- Forum
- Database
- Oracle Database
- Want to change the datatype of the column
Want to change the datatype of the column
This is a discussion on Want to change the datatype of the column within the Oracle Database forums, part of the Database category; Hi I have data in a table. I need to change the datatype of a column. say from int to ...
-
Want to change the datatype of the column
Hi
I have data in a table. I need to change the datatype of a column.
say from int to varchar2.
I am working on oracle9i database.
I used alter command but that will work only if the table is empty.
Please can anyone suggest me the solution I would be very much thankful.
Also if i created a temp column is there any command to copy the data from one column to temp column.
Your help would be greatly appreciated.
Thank you very much,
siri6589
-
Hello Siri,
Step 1: Create a temp column
Step 2 : update table set temp column = old column
Step 3: add new column with desired data type
step 4: drop the old column
step 5 : update table set new column = temp column
Step 6: delete temp column
Let me know how it goes..
Thanks,
-
Guru is greate
its a good idea...but I think he is asking a single command ..right?
-
Sponsored Ads

Reply With Quote





