Select Statement Using Dg4odbc Gateway To Postgres Not Showing Correct Data For Large Values (Doc ID 1263666.1)

Last updated on JANUARY 18, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.2 [Release 11.2]
Information in this document applies to any platform.
Postgres
Openlink
Odbc
Dg4odbc
SQL*Plus


Symptoms


Selecting a number data type from a Postgres database using Database Gateway for ODBC (DG4ODBC) and the Postgres ODBC driver in some cases is returning incorrect data for very large values.

For example:

From Postgres, not using DG4ODBC -

select * from mytable where mynumber = 68

id1 |id2 |mynumber
-----------+-----------+-----------
20089 |188895 |68
20067 |188780 |68
21155 |193296 |68
21330 |194066 |68

result set 1 returned 4 rows.


From Oracle SQL*Plus using DG4ODBC -

SQL> select * from "mytable"@mydblink where "mynumber" = 68;
----------------------- ----------------------- -----------------------
86187108748921 810803926327775 292057776196
90860033166947 830199998636396 292057776196
91611652444835 833507123458832 292057776196
21330 194066 68


The Postgres columns are created as "integer NOT NULL"

A SQLPLUS describe shows the table as:

id1         NOT NULL NUMBER(10)
id2         NOT NULL NUMBER(10)
mynumber    NOT NULL NUMBER(10)


The odbc driver being used for the connection is the Openlink odbc driver.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms