Subject Re: [IB-Conversions] Two constraints for different columns
Author Helen Borrie
At 12:37 PM 17-08-00 +0200, you wrote:
>Hello,
>
>I've shortened my problem as much as possible to show the effect.
>I have to tables created as
>
>
>CREATE TABLE Menu (
> IdMenu int NOT NULL ,
> PRIMARY KEY (IdMenu)
>) ;
>
>CREATE TABLE WebSeite (
> IdWebSeite integer NOT NULL,
> PRIMARY KEY (IdWebseite)
>);
>
>Well in fact they contain more columns but just to make it simple.
>Now I wanted to create a further table:
>
>SQL> CREATE TABLE MenuItem (
>CON> IdMenu int CONSTRAINT Menu NOT NULL ,
>CON> IdWebSeite int CONSTRAINT WebSeite NOT NULL
>CON> ) ;
>Statement failed, SQLCODE = -607
>
>unsuccessful metadata update
>-STORE RDB$RELATION_CONSTRAINTS failed
>-attempt to store duplicate value (visible to active transactions) in
>unique index "RDB$INDEX_12"
>SQL>
>
>Could somebody tell me where is the problem in having to CONSTRAINs?
>If I leave out the CONSTRAIN to IdWebSeite all works well.


So leave out CONSTRAINT - it's not syntax. NOT NULL is a recognised column
constraint. I'm darned if I know what it was trying to do there! Now you
know not to do it next time. :))

For straight-out InterBase questions, there is an excellent support forum
interbase@... which you can join by going to www.mers.com. This list
is ONLY for conversion questions.

Helen

http://www.interbase2000.org
___________________________________________________
"Ask not what your free, open-source database can do for you,
but what you can do for your free, open-source database."
(J.F.K.)