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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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, |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change Password for SQL Server User | admin | SQL Server 2005 Tutorials | 2 | 04-07-2006 11:09 AM |
| *.answers post-approval guidelines | *.answers moderation team | Tech FAQ | 0 | 06-18-2004 12:45 AM |
| Solaris x86 FAQ 2/2 | Dan Anderson | Tech FAQ | 0 | 04-27-2004 07:24 PM |
| Quarterly ASCII posting of Caldera (SCO) OpenUNIX 8 FAQ | Boyd Lynn Gerber | Tech FAQ | 0 | 04-25-2004 10:11 PM |
| Kerberos FAQ, v2.0 (last modified 8/18/2000) | Ken Hornstein | Tech FAQ | 0 | 04-17-2004 07:28 AM |