INFORMIX
Informix-ESQL/C Programmer's Manual
Chapter 2: INFORMIX-ESQL/C Data Types
Home Contents Index Master Index New Book

The BOOLEAN Data Type

ESQL/C uses the boolean data type to support the SQL BOOLEAN data type. For a complete description of the SQL BOOLEAN data type, see the Informix Guide to SQL: Reference. This section describes how to manipulate the ESQL/C boolean data type.

You can declare a boolean host variable as follows:

In an ESQL/C program, the following values are the only valid values that you can assign to boolean host variables:

Boolean Value Representation

TRUE

'\1'

FALSE

'\0'

NULL

Use the rsetnull() function with the CBOOLTYPE as the first argument

If you want to assign the character representations of 'T' or 'F' to a BOOLEAN column, you must declare a fixchar host variable and initialize it to the desired character value. Use this host variable in an SQL statement such as the INSERT or UPDATE statement. The database server converts the fixchar value to the appropriate BOOLEAN value.

The following code fragment inserts two values into a BOOLEAN column called bool_col in the table2 table:




Informix-ESQL/C Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.