Closed ivanarielcaceres closed 5 years ago
Hi!
I really need to solve this issue. I understand that boolean values requrires special mapping but what can i do in this situation?
informix@irk:/data/informix/IBM/OpenInformix/Py$ cat bool.py
import IfxPy
ConStr="Driver={IBM INFORMIX ODBC DRIVER};SERVER=irk1210;DATABASE=stores7;host=irk;service=9088;protocol=onsoctcp"
conn=IfxPy.connect(ConStr,"informix","dummy")
if conn:
stmt = IfxPy.exec_immediate(conn, "SELECT 'T'::boolean,'F'::boolean FROM systables")
res = IfxPy.fetch_tuple(stmt)
print (res[0],res[1])
if res[0]:
print ("col0 is true")
else:
print ("col0 is false")
if res[1]:
print ("col1 is true")
else:
print ("col1 is false")
informix@irk:/data/informix/IBM/OpenInformix/Py$ python bool.py
(1, 0)
col0 is true
col1 is false
informix@irk:/data/informix/IBM/OpenInformix/Py$
Thanks! It worked like a charm.
Hi everybody!
When I read columns of type Boolean T | F, I return None. Is there any configuration or parameter needed to read them correctly?
Thanks in advance