Your Dynamic Net Twain Serial Number Is Invalid
A very easy one for someone,The following insert is giving me theORA-01722: invalid numberwhy? INSERT INTO CUSTOMER VALUES (1,'MALADY','Claire','27 Smith St Caulfield','0419 853 694');INSERT INTO CUSTOMER VALUES (2,'GIBSON','Jake','27 Smith St Caulfield','0415 713 598');INSERT INTO CUSTOMER VALUES (3,'LUU','Barry','5 Jones St Malvern','0413 591 341');INSERT INTO CUSTOMER VALUES (4,'JONES','Michael','7 Smith St Caulfield','0419 853 694');INSERT INTO CUSTOMER VALUES (5,'MALADY','Betty','27 Smith St Knox','0418 418 347'). If you do an insert into.select. from.statement, it's easy to get the 'Invalid Number' error as well.Let's say you have a table called FUNDACCOUNT that has two columns: AIDYEAR char(4)OFFICEID char(5)And let's say that you want to modify the OFFICEID to be numeric, but that there are existing rows in the table, and even worse, some of those rows have an OFFICEID value of ' ' (blank). In Oracle, you can't modify the datatype of a column if the table has data, and it requires a little trickery to convert a ' ' to a 0. So here's how to do it:. Create a duplicate table: CREATE TABLE FUNDACCOUNT2 AS SELECT.
Serial Number Check
Your Dynamic Net Twain Serial Number Is Invalid Number
FROM FUNDACCOUNT;. Delete all the rows from the original table: DELETE FROM FUNDACCOUNT;.Once there's no data in the original table, alter the data type of its OFFICEID column: ALTER TABLE FUNDACCOUNT MODIFY (OFFICEID number);.But then here's the tricky part. Because some rows contain blank OFFICEID values, if you do a simple INSERT INTO FUNDACCOUNT SELECT. FROM FUNDACCOUNT2, you'll get the 'ORA-01722 Invalid Number' error. In order to convert the ' ' (blank) OFFICEIDs into 0's, your insert statement will have to look like this:INSERT INTO FUNDACCOUNT (AIDYEAR, OFFICEID) SELECT AIDYEAR, decode(OFFICEID,' ',0,OFFICEID) FROM FUNDACCOUNT2.