OpenInformix / IfxPy

Informix native Python driver for scalable enterprise and IoT solutions.
Other
46 stars 22 forks source link

BigSerial none value #55

Open matheusgmaia opened 3 years ago

matheusgmaia commented 3 years ago

Hello, I'm having a problem fetching some data from a column with type bigserial. It always returns None. This specific type is not supported? The same query returns me information with SQuirreL.

WhatsApp Image 2020-11-24 at 15 40 12

71527e94-0588-445e-acc6-aca7ad0587c7

92e9421e-b635-44a7-b806-9f9ac63c64a1

Thanks in advance

jsagrera commented 3 years ago

There are some issues with BIGINT and BIGSERIAL within the Informix ODBC driver (which is what the Python module uses). I know is not ideal but it should work if you cast the BIGSERIAL column to INT8. Somelike like: select sqitem.sqitemnfe::int8, sqitem.dsproducto .........

matheusgmaia commented 3 years ago

Worked!!

There is any overflow risk?

Thanks a lot

jsagrera commented 3 years ago

Not that I'm aware, if any INT8 is bigger than BIGINT (10 bytes vs 8 bytes) but only regarding storage, and you are not changing that.

liaosnet commented 2 years ago

BIGSERIAL and BIGINT are define as SQL_INFX_BIGINT。 You can define SQL_INFX_BIGINT at ifxpyc.c like SQL_BIGINT (int8/serial8).