Skip to Content.
Sympa Menu

freetds - [freetds] using BINARYBIND in dbbind() would throw "DB-Library Error 20033" error?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "efendy ma" <efendy.ma AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] using BINARYBIND in dbbind() would throw "DB-Library Error 20033" error?
  • Date: Fri, 23 Mar 2007 08:55:57 +0700

Hi sirs,



I've worked with freetds-0.64 and its dblib. I'm getting problem in using *
dbbind* with *BINARYBIND* to retrieve binary value(type SYBBINARY <45> from
SYBase).

I see the library throws an error called "DB-Library Error 20033: User
attempted a dbbind with mismatched column and variable types". I will show
you my snippet source code at the end of this email.

For further interogations, I've tried to gdb. I have seen *SYBBINARY* <45>
changed to *SYBVARBINARY* <37> in dbbind. Thus, later, the feedback in
deeper function tds_willconvert will return 0 and dbbind will fail. Is it as
should be?

I've done well with SYBIMAGE to retrieve LONG BINARY servert data type.

Is there any way to bind BINARY type to local program using dbbind? If yes,
please show me the snipped code. I would be very thankful for your help.



XTABLE:

Name TYPE

CBINARY BINARY(200)

LBINARY LONGBINARY



Source code:

DBBINARY testbinary[255];

int collen;

.

.

.

nColType = dbcoltype(pDbProc[nCursorId], nI);

collen = dbcollen(pDbProc[nCursorId], nI);

switch( nColType)

{

case SYBVARBINARY:

case SYBBINARY:

dbbind(pDbProc[nCursorId], nI, BINARYBIND,
(DBINT)collen, testbinary);



break;

case SYBIMAGE:

nRet=dbbind(pDbProc[nCursorId], nI, BINARYBIND,
(DBINT)collen, testLBinary);

. break;

.

.



Thank you for your time,



efendy



  • [freetds] using BINARYBIND in dbbind() would throw "DB-Library Error 20033" error?, efendy ma, 03/22/2007

Archive powered by MHonArc 2.6.24.

Top of Page