Firebird + 6.6.1 + Default Values for new record

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
claudioc
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 17.08.2005, 09:08

Firebird + 6.6.1 + Default Values for new record

Post 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.
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post by gto »

Hello there!

Ahum.. correct me if I'm wrong, but firebird doesn't have a BOOLEAN data-type, right?
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
claudioc
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 17.08.2005, 09:08

Post 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.
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

For the field in question set
Required := False;
that should do the trick.

Regards,

Ben
Post Reply