JayCap
JayCap

Reputation: 23

Informix constraint SQL syntax in create table statements

Noticed schema has changed on an Informix database for checking constraint in the create table statements. Will this be a problem for my application read/write to this table if there are no other differences to the field names, data types, etc..

Example of the original: check (cs_addl IN ('y' ,'n' )),

Example of the new schema: check (cs_addl IN ('y' ,'n' )) constraint "informix".cs_check4,

Upvotes: 2

Views: 318

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 754470

TL;DR — There's no problem and no change of behaviour.

The constraint name appears in the 'wrong' place compared to standard SQL, but that has no effect on the behaviour of the constraint. (You can find more information at GitHub — SQL specifications for SQL-92, SQL-99, SQL-2003). It just gives you a more convenient name to use if you ever need to drop or disable the constraint.

Even NOT NULL constraints formally have names; a name is created for you if you (like everyone else) don't name it.

Upvotes: 1

Related Questions