Datatype Conversion Error ORA-28528 Using Dg4odbc With Informix, MySQL or SQL*Server 64-bit ODBC Drivers on Unix Platforms (Doc ID 554409.1)

Last updated on JANUARY 19, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.6 to 11.2.0.3 [Release 11.1 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 09-DEC-2011***
***Checked for relevance on 08-JAN-2014***

Symptoms



DG4ODBC has been used to setup a connection to Informix, MySQL or SQL*Server using a 64-bit Informix, MySQL or SQL*Server ODBC driver on Unix or Linux.
This does not apply to Windows platforms.


Select count of a table works successfully but when trying to select records the following error occurs -

SQL> select * from "table"@dg4odbc;
ERROR:
ORA-28528: Heterogeneous Services datatype conversion error
ORA-02063: preceding line from DG4ODBC

no rows selected


If "table" has a column called "code1" defined as char(3) an DG4ODBC debug trace will show the following -

Column "code1": dtype=1, colsize=3, decdig=0, char_octet_length=3, cumulative
avg row len=12

then further on -

Entered hgoopen, cursor id 1 at 2008/01/08-14:06:44
hgoopen, line 83: NO hoada to print
Exiting hgoopen, rc=0 at 2008/01/08-14:06:44
Entered hgodscr, cursor id 1 at 2008/01/08-14:06:44
Entered hgopcda at 2008/01/08-14:06:44
Column:1(code1): dtype:1 (CHAR), prc/scl:3/0, nullbl:1, octet:3, sign:1,
radix:0
Exiting hgopcda, rc=0 at 2008/01/08-14:06:44
hgodscr, line 506: Printing hoada @ 0x970c750
MAX:1, ACTUAL:1, BRC:100, WHT=5
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
1 CHAR Y 3 3 0/ 0 0 0 0 code1
Exiting hgodscr, rc=0 at 2008/01/08-14:06:44
Entered hgoftch, cursor id 1 at 2008/01/08-14:06:44
hgoftch, line 117: Printing hoada @ 0x970c750
MAX:1, ACTUAL:1, BRC:100, WHT=5
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
1 CHAR Y 3 3 0/ 0 0 0 0 code1
SQLBindCol: column 1, cdatatype: 1, bflsz: 4
SQLFetch: row: 1, column 1, bflsz: 4, bflar: -1
SQLFetch: row: 1, column 1, bflsz: 4, bflar: SQL_NULL_DATA

 

but some rows do not report SQL_NULL_DATA -

SQLFetch: row: 31, column 1, bflsz: 4, bflar: 3
SQLFetch: row: 31, column 1, bflsz: 4, bflar: 3



and files end with -

SQLFetch: row: 100, column 1, bflsz: 4, bflar: 0
SQLFetch: row: 100, column 1, bflsz: 4, bflar: 0
100 rows fetched
Exiting hgoftch, rc=0 at 2008/01/08-14:06:44
Entered hgoclse, cursor id 1 at 2008/01/08-14:06:55
Exiting hgoclse, rc=0 at 2008/01/08-14:06:55
Entered hgodafr, cursor id 1 at 2008/01/08-14:06:55
Exiting hgodafr, rc=0 at 2008/01/08-14:06:55
Entered hgocomm at 2008/01/08-14:06:55
keepinfo:0, tflag:1
00: 534E4743 41544144 3662632E 63356662 [CGNSDATA.cb6bf5c]
10: 30312E35 2E36322E 373337 [5.10.26.737]
tbid (len 24) is ...
00: 534E4743 41544144 2E30315B 372E3632 [CGNSDATA[10.26.7]
10: 5B5D3733 5D342E31 [37][1.4]]
cmt(0):
Entered hgocpctx at 2008/01/08-14:06:55
Exiting hgocpctx, rc=0 at 2008/01/08-14:06:55
Exiting hgocomm, rc=0 at 2008/01/08-14:06:55
Entered hgolgof at 2008/01/08-14:06:55
tflag:1
Exiting hgolgof, rc=0 at 2008/01/08-14:06:55
Entered hgoexit at 2008/01/08-14:06:55
Exiting hgoexit, rc=0 at 2008/01/08-14:06:55

 

An ODBC trace shows the following -

[ODBC][21757][SQLBindCol.c][165]
Entry:
Statement = 0x666420
Column Number = 1
Target Type = 1 SQL_CHAR
Target Value = 0x680df8
Buffer Length = 4
StrLen Or Ind = 0x6812e0

The 'buffer length' is shown as 4 but it should be 8 for 64-bit platforms.

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