473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Datatype cannot be changed in table

I tried using the command alter table. But it is throwing the error as the datatype must be null to change the datatype. As i am trying to change the datatype from char(50) to NUMBER(2,0). As far as my searching in google, It is asking to drop the column and reinsert if yu need to change the datatype. It contains over 1000 datas. now i am really confused how to change the datatype to proceed further. Your idea or solution is highly appreciable.
Thanks in advance..!!!
Mar 14 '13 #1
6 1487
r035198x
13,262 8TB
What do you want Oracle to do if you already have data in there that is not numbers and that is longer than 2 characters?
Mar 14 '13 #2
No actually numbers are only present with only two numbers in each field. The data's are transferred from another source through a middle-ware Tuxedo. This type of imports mainly causes change in data type. So could u help me out of this?
Mar 14 '13 #3
r035198x
13,262 8TB
If you are allowed to alter the columns then chances are you are allowed to create and drop new ones as well.

So the safest approach is:
1.) Backup your data
2.) Create a new column (call it anything you want)
3.) Run an update copying from the old column to the new column
4.) Drop the old column.
5.) Create the new column with the right type.
6.) Run an update to copy from the column you created in 2.) above to the new correct column.
7.) Drop the column you created in 2.) above
Mar 14 '13 #4
Yep not a bad idea but it has 100 rows with data's and it is so tedious to manually insert it again. So m searching for an alternative one, if no other option is left that's the only way left i guess :(
Mar 14 '13 #5
r035198x
13,262 8TB
Read the instructions I posted again. You don't have to run 100 statements. You'll only run a maximum of 6 statements no matter how many records there are in the database.
Mar 14 '13 #6
Ohh Fine Fine,...Thanks for your valuable instructions r035198x..!!
Mar 14 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sangbae | last post by:
I cannot create table using adodbapi. I have no problem with SELECT etc. But I can create table using win32com.client directly. I don't know why. Could you give some advice, please? This...
1
by: Hechmi | last post by:
I am trying to retrieve the users of the company using active directory. When i execute the code below , it gives the following error "The Active Directory datatype cannot be converted to/from...
1
by: Frank Rizzo via SQLMonster.com | last post by:
I have a new installation of SQL Server 2000 Dev Edition on a Win2K3 Standard Edition Server that I used for development. I just set this machine up in th last week and installed all Win2K3 patches...
1
by: Query Builder | last post by:
I have a table that has an image datatype column and I also have a contant type column in that same table to define which type of data is stored in that table. In this case a screen shot or may...
0
by: Matthew Louden | last post by:
I am trying to implement the sort event in data grid. I set the data grid's AllowSorting property = True. I implement the following code that should be the event will fire when the user click any...
3
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection...
2
by: Johan Delimon | last post by:
"The active directory datatype cannot be converted to/from a native DS datatype" I have an ASP.NET web page that uses queries to AD to identify current users. Delegation is configured in AD and...
0
by: Andre.Iskandar | last post by:
Hi, I make an acess program using Access 2000 and convert it to Access 2002. When I convert it back to Access 2000, I cannot see table, query and form names (maybe other tabs too). But they exist...
0
by: oracle_corrgi | last post by:
hi want to update data from column update_on data type varchar2(1200) to column temp_update datatype timestamp in the same table this works because same datatype update tablename set...
2
by: dowlingm815 | last post by:
I am attempting to create a table with an index. however, i am receiving an error code "3371: Cannot find table or constraint" as soon as it reads the "create index" statement. The code is as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.