Subject Problem with default 0 not null in a table
Author mgdjorov
I have one server with two identical databases.
In them there is a table like:

TABLE1 (
ID INTEGER NOT NULL,
NAME VARCHAR(30),
STATUS SMALLINT DEFAULT 0 NOT NULL)

and trigger

CREATE TRIGGER TR_TABLE1_BI0 FOR TABLE1
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(GEN_TABLE1_ID,1);
END;

When I execute INSERT INTO TABLE1(NAME) VALUES ('SOMETHING');
in the first database STATUS get value NULL, in the second database
the value is 0 as it has to be.

OS Windows 2003
Firebird 2.0.3 12981

Can you tell me what is wrong?