问题
Inserting null into not null column with default is giving me a validation error instead of taking the default value. I don't want to make on before triggers to all of the tables. Is there any other way to do this?
Firebird 2.1.3
回答1:
The default value is used when you omit a field in the insert, not when you include the field with a null value.
Example:
Uses default for Name
:
insert into SomeTable (Id) values (42)
Tries to insert null
into Name
:
insert into SomeTable (Id, Name) values (42, null)
来源:https://stackoverflow.com/questions/3716036/insert-null-into-not-null-column-with-default-firebird