views:

41

answers:

1

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

+2  A: 

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)
Guffa