Home » SQL & PL/SQL » SQL & PL/SQL » Invalid Number Error
Invalid Number Error [message #9486] Fri, 14 November 2003 11:06 Go to next message
mkr
Messages: 2
Registered: November 2003
Junior Member
This insert is driving me nuts. I just can't see the problem. Can anyone help. Below is the query, the response, and the table.

insert into EMPLOYEE_SHIFT (
Emp_Shift_ID, Emp_ID, Store_ID, Manager_ID, Time_Start, Time_Stop)
VALUES ('1000001', '000000001', '001', '000000001',
TO_DATE('11/20/2003 8:00', 'MM/DD/YYYY HH24:MI'),
TO_DATE('11/20/2003 17:00', 'MM/DD/YYYY HH24:MI')
);

Emp_Shift_ID, Emp_ID, Store_ID, Manager_ID, Time_Start, Time_Stop)
*
ERROR at line 2:
ORA-01722: invalid number

Research says that the "invalid number" error can occur when oracle is making a string to number conversion. But as you can see by the table below, Emp_Shift_ID is a varchar2, and my input is a quoted string.

Can anyone see the problem?

SQL> desc employee_shift
Name Null? Type
-------- -------- ---------
EMP_SHIFT_ID.....NOT NULL.....VARCHAR2(7)
EMP_ID...........NOT NULL.....VARCHAR2(9)
STORE_ID.........NOT NULL.....VARCHAR2(3)
MANAGER_ID....................VARCHAR2(9)
TIME_START.......NOT NULL.....DATE
TIME_STOP........NOT NULL.....DATE
Re: Invalid Number Error [message #9488 is a reply to message #9486] Fri, 14 November 2003 13:43 Go to previous messageGo to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
It works for me, but some time ago I had something similar to this, only with dates, not with strings, and it was related to ODBC driver settings. I don't remember details, but I remember rewriting my statement.
Re: Invalid Number Error [message #9489 is a reply to message #9486] Fri, 14 November 2003 18:44 Go to previous message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
Works fine for me. Are there any triggers on the table?
Previous Topic: Outer Join on BETWEEN command?
Next Topic: PL/SQL table of records in 8.1.7
Goto Forum:
  


Current Time: Fri Apr 26 17:56:27 CDT 2024