Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle-l »

RE: ORA-01722 error in 10g

Ram Srinivasan

2007-07-11

Replies:


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.
©2008 dba.5341.com - Jax Systems, LLC, U.S.A.