dbTalk Databases Forums  

create table error with constraint...

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss create table error with constraint... in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Volker Hetzer
 
Posts: n/a

Default Re: create table error with constraint... - 09-11-2008 , 12:01 PM






Dan Blum schrieb:
Quote:
Volker Hetzer <firstname.lastname (AT) ieee (DOT) 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))
Will do.

Thanks a lot!
Volker
--
For email replies, please substitute the obvious.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.