Page 1 of 1

Firebird + 6.6.1 + Default Values for new record

Posted: 10.09.2007, 22:29
by claudioc
In previous version, default values for fields in Firebird were correctly set.
Now this behaviour is changed.
Then, for example, if my Table is defined in Firebird as:
CREATE TABLE UM (
CODICEUM VARCHAR(2) NOT NULL,
UM VARCHAR(15),
APPALTI BOOLEAN DEFAULT 'False' NOT NULL);
and my ZQuery.sql is:
select * from um ORDER BY CODICEUM
and I insert a new record by compiling fields CODICEUM and UM,
the message is "FIELD APPALTI must have a value.
In previous version od Zeos, the field was correctly set.
What can I do? I don't want to correct the source, because I need that the changes in database structure don't need to change also the program source.
Thanks a lot

Claudio C.

Posted: 11.09.2007, 15:12
by gto
Hello there!

Ahum.. correct me if I'm wrong, but firebird doesn't have a BOOLEAN data-type, right?

Posted: 11.09.2007, 15:26
by claudioc
No, in Firebird 1.5 there's not boolean data-type.
But this's not the question. The problem appears in other cases and in other fields (varchar, numeric,...).
The question is:
-if sql-select in Zeos Query contains the field and I don't fill it with correct value, I obtain error (the field is NULL).
-if sql-select in Zeos Query doesn't contain the field, no problem because the database server applies default values.
In previous version of Zeos, this problem doesn't exist.

Posted: 12.09.2007, 10:14
by btrewern
For the field in question set
Required := False;
that should do the trick.

Regards,

Ben