Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: improbable ora-01722
On Aug 22, 2:28 pm, steph <stepha..._at_yahoo.de> wrote:
> This bugged me a bit today:
>
> create table steptest(a number);
>
> alter table steptest add (constraint steptest_check1 check (a in
> ('J','N')));
>
> insert into steptest values (1);
>
> ==>ORA-01722
>
> Of course the check constraint makes no sense on this column ... but
> Oracle (9i) does not mind. The resulting error message led me in
> completely wrong directions. Bug or feature?
>
> stephan
You get this error because oracle tries to cast 'J' and 'N' to a number type and it cannot be done since J and N are not numeric literals.
![]() |
![]() |