is it support constraint ?
Posted in 1999
Topics: General Discussion
---------------------my error-------------------- constraint PK_xxxxxxxx primary key (xxx, xxxx) # ^ # 201: syntax error± # ------------------------------------------------- I cannot found keyword ,constraint , in manual... is informix support constraint?? is informix different syntax?? if so, what keyword??
PRIMARY KEY (xxx,xxxxx) CONSTRAINT pk_xxxxx
or
ALTER TABLE tablename ADD CONSTRAINT ( PRIMARY KEY (xxx,xxxxx)
CONSTRAINT pk_xxxxx)
Chang-Woo Park wrote:
> ---------------------my error--------------------
> constraint PK_xxxxxxxx primary key (xxx, xxxx)
> # ^
> # 201: syntax error±
> #
> -------------------------------------------------
> I cannot found keyword ,constraint , in manual...
>
> is informix support constraint??
>
> is informix different syntax??
> if so, what keyword??
Chang-Woo Park wrote: > > ---------------------my error-------------------- > constraint PK_xxxxxxxx primary key (xxx, xxxx) > # ^ > # 201: syntax error± > # > ------------------------------------------------- > I cannot found keyword ,constraint , in manual... > > is informix support constraint?? Informix supports constraint names. > is informix different syntax?? Yes; it uses a non-standard position for the constraint: PRIMARY KEY (xxx, xxxx) CONSTRAINT pk_xxxxxxxx > if so, what keyword?? Same keyword, different position in statement. I think this was because a draft version of what became SQL-92 had the CONSTRAINT in the Informix location -- at least, that's the best excuse I can think of (and Informix did introduce PK in 1990 -- v5.00). -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>