booleaninformixsqldatatypes

How to store a boolean value in an Informix database?


I have created an insert statement for the Informix database (version IBM Informix Dynamic Server version 14.10.FC10AEE).

This looks like the following:

INSERT INTO person ('name', is_active)
VALUES ('peter', true);
column Data type
id serial
name char(50)
is_active boolean

I get the following error message:

SQL Error [42000]: A syntax error has occurred.

I suspect it is because the boolean value true cannot be processed correctly by Informix.

I had already tried it with the value 1, which did not work either. I get the following error message:

SQL Error [IX000]: Value does not match the type of column (is_active).


Solution

  • The legal values for the boolean data type are 't' 'f' and null. The quotes for the true and false values are required.