Subject NOT NULL constraint not being enforced by Firebird
Author dr_bentonquest
Hi there,

I have a Firebird table wich haves two 'not null' fields:

CREATE TABLE DETALLENOM (
...
DEDXTRA NUMERIC(9,2) default 0 NOT NULL,
PERXTRA NUMERIC(9,2) default 0 NOT NULL
);

However there are currently 'null' values on many rows. I don't
understand why the constraint
is not being enforced here. I do have a procedure that inserts records
on that table, using an INSERT command:

insert into DETALLENOM
(IDNOMINA,EMPLEADO,FACTORINTEG,SALARIONOINT,INFONAVIT)
values (:idnomi,:vNumemp,:vFactorinteg,:vSaldiarionoint,:vInfonavit);

Please note that the DEDXTRA and PERXTRA fields are not in the INSERT
field list. I tought they would receive the default value (a zero).
Instead, I get null values on them, which I can easily confirm
with a SELECT.

So, under which conditions would a 'not null' field accept null
values? Using FB 1.5.3 for Linux.

Thanks,

-Benton