Boolean Default 0 - conversion error from string "0" #8728
-
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. CREATE TABLE TESTSTABLE (
TESTFIELD1 BOOLEAN DEFAULT 0 NOT NULL,
TESTFIELD2 BOOLEAN DEFAULT 0 NOT NULL
);
This command is OK for all versions. CREATE TABLE TESTSTABLE (
TESTFIELD1 BOOLEAN DEFAULT FALSE NOT NULL,
TESTFIELD2 BOOLEAN DEFAULT FALSE NOT NULL
); But now I have a problem. Restoring with Firebird 5.0.3 works. The table is also created and it works just like in Firebird 3. 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”. What can I do? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
You should change default: |
Beta Was this translation helpful? Give feedback.
-
Doesn't work. I get the message “conversion error from string ”0“”. |
Beta Was this translation helpful? Give feedback.
-
Then alter them both at once? |
Beta Was this translation helpful? Give feedback.
-
That is, try ALTER TABLE TESTTABLE ALTER COLUMN TESTFIELD1 SET DEFAULT FALSE, ALTER COLUMN TESTFIELD2 SET DEFAULT FALSE |
Beta Was this translation helpful? Give feedback.
-
@mrotteveel Thank you very much, that works. |
Beta Was this translation helpful? Give feedback.
-
As this seems to be more a support question (and the fact it was originally even possible to use |
Beta Was this translation helpful? Give feedback.
That is, try