You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Boolean Default 0 - conversion error from string "0" #8727
The following Create Table command works with 3.0.4, but it does not work with newer versions such as 3.0.13, 4.0.6, or 5.0.3.
With the newer versions, I get the following error message
**error message**
Overflow occurred during data type conversion.
conversion error from string "0".
----------------------------------------------
SQLCODE: -413
SQLSTATE: 22018
GDSCODE: 335544334
This command is OK for all versions.
CREATETABLETESTSTABLE (
TESTFIELD1 BOOLEAN DEFAULT FALSE NOT NULL,
TESTFIELD2 BOOLEAN DEFAULT FALSE NOT NULL
);
But now I have a problem.
I have an existing Firebird 3.0.4 database with a table that contains such a field, and I can no longer correct it in order to migrate to Firebird 5.0.3.
Restoring with Firebird 5.0.3 works. The table is also created and it works just like in Firebird 3.
But if I want to edit a field in the affected table or remove or edit one of the fields with “BOOLEAN DEFAULT 0,” I always get the message "Overflow occurred during data type conversion.
conversion error from string “0”."
Since the table with “BOOLEAN DEFAULT 0” also works with Firebird 5 and new records are also pre-populated with FALSE, I consider this to be an error in the new versions in “CREATE TABLE” or “ALTER TABLE”.
Doesn't work. I get the message “conversion error from string ”0“”.
Probably because it also finds the error in the other field?
I have two fields that have “BOOLEAN DEFAULT 0”.
As this seems to be more a support question (and the fact it was originally even possible to use DEFAULT 0 on a Boolean was - AFAIK - a bug), I'll move this to Discussions.
Activity
aafemt commentedon Sep 4, 2025
You should change default:
ALTER TABLE TESTTABLE ALTER COLUMN TESTFIELD1 SET DEFAULT FALSEnLeonardt95 commentedon Sep 4, 2025
Doesn't work. I get the message “conversion error from string ”0“”.
Probably because it also finds the error in the other field?
I have two fields that have “BOOLEAN DEFAULT 0”.
mrotteveel commentedon Sep 4, 2025
Then alter them both at once?
mrotteveel commentedon Sep 4, 2025
That is, try
nLeonardt95 commentedon Sep 4, 2025
@mrotteveel Thank you very much, that works.
mrotteveel commentedon Sep 4, 2025
As this seems to be more a support question (and the fact it was originally even possible to use
DEFAULT 0on a Boolean was - AFAIK - a bug), I'll move this to Discussions.