Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ORA-01722 - Invalid Number
"Hussein METDAOUI" <hmetdaoui_at_eyrolles.com> wrote in message
news:3B2647FF.5105DFF1_at_eyrolles.com...
Hi !
I've found a bad query in a web site :
select * from table where id=1321313 ...... without quote :-)
Before today this runs.
Now each time i use this kind of query an error occurs :
ORA-01722 -Invalid Number
No changes have been done to the database before that.
Now i've corrected the query : select * from table where id='1321313' and
it runs.
Anyone knows this problem ?
Thanks......
Apache/PHP3/Oracle 8.0.5 under Linux 6.2
Your column is a varchar2 column
This forces Oracle to perform implicit type conversion
The type conversion was resolved by changing internally
id = <hard coded literal>
into
to_number(id) = <hardcoded literal>
So three conclusions:
- there is alphanumeric data in your id column, so it is not truly numeric
anymore
- always perform explicit type conversion yourself, or specify the proper
type
- if the id column is truly numeric, make sure the column is a number, this
takes much less space.
Hth,
Sybrand Bakker, Oracle DBA Received on Tue Jun 12 2001 - 13:39:43 CDT
![]() |
![]() |