Re: create table error with constraint...

From: Dan Blum <tool_at_panix.com>
Date: Fri, 25 Jul 2008 15:13:50 +0000 (UTC)
Message-ID: <g6cqje$qbs$1@reader1.panix.com>


Volker Hetzer <firstname.lastname_at_ieee.org> wrote:
> Hi!
> I've got a simple problem with a create table statement:
> CREATE TABLE HB_ATTRIBUTE (
> STRINGVALUE VARCHAR2(4000 CHAR),
> DATEVALUE DATE,
> CONSTRAINT TCC_HB_ATTRIBUTE_1 CHECK ((STRINGVALUE is null)<>(DATEVALUE is
> null)) DEFERRABLE INITIALLY DEFERRED);

> This gives me an "ORA-00907: missing right paranthesis" at the "<>".
> I have no idea what I'm doing wrong.
> I'm using 10.2.0.1.0 on linux 32 bit.
> Can anybody help me out?

You can't compare boolean values that way in SQL. You can do something like this:

((decode(stringvalue, NULL, 1, 0) != decode(datevalue, NULL, 1, 0))

-- 
_______________________________________________________________________
Dan Blum					         tool_at_panix.com	
"I wouldn't have believed it myself if I hadn't just made it up."
Received on Fri Jul 25 2008 - 10:13:50 CDT

Original text of this message