Insert null into non-null default column FIREBIRD

Inserting a null column with a null default value gives me a validation error instead of the default value. I do not want to include all triggers in all tables. Is there any other way to do this?

Firebird 2.1.3

+3
source share
1 answer

The default value is used when you omit the field in the insert, and not when you include the field with a null value.

Example:
Used by default for Name:

insert into SomeTable (Id) values (42)

Tries to paste nullinto Name:

insert into SomeTable (Id, Name) values (42, null)
+5
source

Source: https://habr.com/ru/post/1764844/


All Articles