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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Check constraint question

Re: Check constraint question

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Fri, 25 Aug 2006 01:10:44 +0100
Message-ID: <cffse2p6vekhle2dgt051h76r967fh3sie@4ax.com>


On Fri, 25 Aug 2006 01:24:52 +0200, Sybrand Bakker <postbus_at_sybrandb.demon.nl> wrote:

>>not a silly question. The point of the post is that I wanted to know
>>if it's going to work before I even give it to the DBA in charge of
>>creating the database.
>
>Ahh, I see, so you want US to try it.

 This remonstration is valid; the OP should try it first on his own database, not ask other people to run what his own computer can run.

>The only thing I remember (from a while ago) is constructs like you
>posted do NOT work, and you are limited to using DECODE expressions
>returning *boolean* true or false.

 The OP's expression does evauluate to Boolean true or false; it's a Boolean expression. It WILL work.

 A DECODE statement can NEVER return true or false, as there is no Boolean type on the SQL level, only on the PL/SQL level. A DECODE will NOT work as the subject of a check constraint - you'll just get "ORA-00920: invalid relational operator"

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Thu Aug 24 2006 - 19:10:44 CDT

Original text of this message

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