Subject Re: [firebird-support] Alter column not null with constraint name FB3
Author livius
>
> Hi,
> I need to add Field not null constraint with my custom
name.
> in previous versions of Firebird we can do:
> 1. ALTER TABLE
XXX ADD FIELDX INTEGER CONSTRAINT NK_XXX__FIELDX NOT NULL;

>>Interestingly, that syntax is not documented in the
Firebird 2.5
>>language reference.
 
it has been available for years. And we use it also in table creation
Create table A
(
FIELD1 INTEGER CONSTRAINT NK_A_FIELD1 NOT NULL
)
 
and this syntax is interchangeably between Firebird and Interbase.
There is difference in message when null is inserted into not null field.
In Interbase there is constraint name in message in Firebird it is not included.
 
In Firebird we have “TABLE”.”FieldName” in message.
Will be good if Firebird will also contain constraint name.
 
And this is good if user can name all self created constraint in the database like it is for all other PK, FK, UK, CK.
You can then have in app standardized handling about e.g. error messages.
 
regards,
Karol Bieniaszewski