1

Eiffel

Seems I'm getting an INTEGER_32_REF from a BIGINT from ODBC with Eiffel DB_SELECTION.cursor. Sometimes I seem to have the adecuate value, but sometimes not...

946383958 => good INTEGER_32_REF (id->4 of following table)
9475984837 => 886050245 WRONG INTEGER_32_REF (id->4 of following table)

646383958 => good INTEGER_32_REF (id->3 of following table)
6475984837 => -2113949755 WRONG INTEGER_32_REF (id->4 of following table)

...

It seems to behave like not treating the BIGINT and giving the INTEGER_32_REF value directly interpreted from the DB value, typical case passing over the 2^32

Postgresql

Having a table with following data as electricity_amount BIGINT NOT NULL DEFAULT 0

id |   a_date   |  amount   | electricity_amount | consumption_sector_id | electricity_rate_id
----+------------+-----------+--------------------+-----------------------+---------------------
1 | 2019-01-01 | 746383958 |         7475984837 |                     1 |                   1
2 | 2019-02-01 | 846383958 |         8475984837 |                     1 |                   1
3 | 2019-03-01 | 646383958 |         6475984837 |                     1 |                   1
4 | 2019-04-01 | 946383958 |         9475984837 |                     1 |                   1

enter image description here

Pipo
  • 4,653
  • 38
  • 47

1 Answers1

2

By default, not all the data types are mapped to Eiffel side. So you will need to inherit from the class GLOBAL_SETTINGS and call the feature set_use_extended_types (True) --| Use extended types: INTEGER_64, STRING_32 etc.

javierv
  • 159
  • 7