Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: ORA-01722 error in 10g

RE: ORA-01722 error in 10g

From: Ram Srinivasan <srinivasanram2004_at_gmail.com>
Date: Wed, 11 Jul 2007 11:29:25 -0400
Message-ID: <9fc1ae810707110829p35cc4a5al213d8e0ec86875d@mail.gmail.com>


*

create* *table* test1(

numbertest varchar2(2));
*

insert* *into* test1
*

values*('12'); *commit*;
*

select* *
*

from* test1
*

where* numbertest = 12; *-- no error. output is 12
**

insert* *into* test1
*

values*('g2'); *commit*;
*

select* *
*

from* test1
*

where* numbertest = 12; *-- ORA-01722: invalid number .
*

This *test* (in 10g) proves that *as* long *as* *the* varchar2 *or* char column does *not* have *a* character *in* *any* *of* *the* *rows*, ORA-01722
*error* does *not* occur.

*If* *the* column has *any* *row* containg *a* character other *than* *a*
number, you get this ORA-01722 *error*.

Ram Srinivasan
Charlottesville, VA.

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 11 2007 - 10:29:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US