cast boolean & dbd::informix
Posted in 2000
Topics: Data Types & Schema Design, Migration, Import/Export & Data Conversion
I have written a perl script using dbd::informix
I am performing a simple select from a table that contains a col of type boolean.
the perl dbd module complains
DBD::Informix::db prepare failed: SQL: -486:
Illegal data type found during data conversions. at dt_test.pl line 20.
my guess is that perl wants it's booleans to be 0|1 instead of 'f'|'t'
however when I attempt to cast the boolean to something else I get an error -9634 (No such cast)
I have perused the manuals and found an explicit list of what may not be cast,
and boolean is not among those types
but I did not see any direct evidance booleans are castable
roughly what (I think) I need is
begin work;
select yaa, dee, yaa, (bool::char) from atable where {a bunch of stuff} into temp orairy;
select first n * from orairy where {whatever...}; -- what is returned to the cgi script
drop table orairy;commit work;
but I am very new to all of this (sql,informix,perl..)
so any solutions or pointers are welcome.
Thanks Tom Conlin
tomc@cs.uoregon.edu
I don't like to speak for Jonathan in general, mostly because he is more
knowledgeable than I in too many areas, his DBD:Informix would certainly
be one, but I believe that DBD:Informix was written pre-IDS.2000 and so
does not understand BOOLEAN. Poke in the source I do not think adding that
particular new datatype will be difficult. Other OO features and new types
will be more troublesome, but now that Jonathan has elicited official
support for the product I hope the folk in Menlo Park will give him the
resources to include them all.
Art S. Kagel
Thomas Enzeley Conlin wrote:
>
> I have written a perl script using dbd::informix
> I am performing a simple select from a table that contains a col of type boolean.
>
> the perl dbd module complains
>
> DBD::Informix::db prepare failed: SQL: -486:
> Illegal data type found during data conversions. at dt_test.pl line 20.
>
> my guess is that perl wants it's booleans to be 0|1 instead of 'f'|'t'
>
> however when I attempt to cast the boolean to something else I get an error -9634 (No such cast)
> I have perused the manuals and found an explicit list of what may not be cast,
> and boolean is not among those types
> but I did not see any direct evidance booleans are castable
>
> roughly what (I think) I need is
>
> begin work;
> select yaa, dee, yaa, (bool::char) from atable where {a bunch of stuff} into temp orairy;>
> select first n * from orairy where {whatever...}; -- what is returned to the cgi script>
> drop table orairy;> commit work;
>
> but I am very new to all of this (sql,informix,perl..)
> so any solutions or pointers are welcome.
>
> Thanks Tom Conlin
>
> tomc@cs.uoregon.edu