埃菲尔:ODBC处理BIGINT

时间:2019-01-31 15:18:36

标签: odbc eiffel

Eiffel

似乎我正在使用Eiffel DB_SELECTION.cursor从ODBC的BIGINT获取INTEGER_32_REF。有时我似乎具有适当的价值,但有时却没有……

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)

...

看起来就像不对待BIGINT并直接从DB值中给出INTEGER_32_REF值一样,典型情况是经过2 ^ 32

PostgreSQL

有一个表,其中的数据为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

1 个答案:

答案 0 :(得分:2)

默认情况下,并非所有数据类型都映射到Eiffel端。 因此,您将需要从类GLOBAL_SETTINGS继承并调用该功能 set_use_extended_types (True) --| Use extended types: INTEGER_64, STRING_32 etc.