Problem in getting boolean data by C++
Posted in 1999
I use C++ to access the data in Informix. There is a problem for boolean
data type.
The schema of the table is like:
create row type rvr_t (
runway varchar(3),
range integer,
variable boolean
);
create table metar (
ident varchar(15),
rvr SET(rvr_t not null),
error boolean
);
There are boolean data type "error" in table metar, and boolean
"variable" in row type rvt_t in table.
I use:
if ( value_type.EqualNoCase("boolean") ) {
bool b;
c->ConvertTo(b);
c->Release();
......
}
to get the boolean values.
For "error", b equals to 0 which means false and 1 for true.
However, for "variable", it returns some different values like 88, 40,
-8, 56 and so on. I can not decide the actual value. In fact, when I
insert 'set{row("run1", 1, "t"), row("run2", 2, "f")}' for "variable", I
get the same values for both 't' and 'f' of "variable" of the two row
data in that set.
Can anyone help me to solve the problem? Thanks in advance.
Jing