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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 10g - Putting a where clause on a column with a check constraint.

Re: Oracle 10g - Putting a where clause on a column with a check constraint.

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 22 Mar 2006 20:53:02 +0100
Message-ID: <qja322d02q374ini92q18knq9cgdbj0b7o@4ax.com>


On 22 Mar 2006 11:10:45 -0800, "Jon" <jonathan.p.crawford_at_gmail.com> wrote:

>
>Has anyone experienced this? Below is an example.
>
>If I don't have the check constraint on the column it works fine. Also
>this worked fine in 9i and we are trying to migrate our application
>onto 10g as new clients are requesting compatability with 10g.
>
>Thanks for all the help.
>
>
>******************************************************************
>create table jon5
>(
>AAA NVARCHAR2(1),
>BBB NVARCHAR2(10),
>CONSTRAINT CC_AAA CHECK(AAA IN('N','Y')),
>CONSTRAINT CC_BBB CHECK(BBB IN('Happy','Sad','Angry'))
>);
>
>insert into jon5 values('Y','Happy');
>insert into jon5 values('Y','Sad');
>insert into jon5 values('Y','Angry');
>insert into jon5 values('N','Sad');
>
>select * from jon5
>A BBB
>- ----------
>Y Happy
>Y Sad
>Y Angry
>N Sad
>
>4 rows selected.
>
>
>select * from jon5 where

Not using NVARCHAR2 myself I seem to recall you needed to prefix hardcoded literals with N everywhere, like N'Happy' If this is true, you are relying on implicit conversion everywhere. Oracle could have become more strict. Also only the variation of National Charactersets has been limited to UTF... starting in 9i.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Mar 22 2006 - 13:53:02 CST

Original text of this message

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