Skip site navigation (1) Skip section navigation (2)

SqlGetData problems

From: Mika Mäntylä <mmantyla(at)soberit(dot)hut(dot)fi>
To: pgsql-odbc(at)postgresql(dot)org
Subject: SqlGetData problems
Date: 2001-10-23 08:40:35
Message-ID: 3BD52D03.70801@soberit.hut.fi (view raw or flat)
Thread:
Lists: pgsql-odbc
I have discovered two problems with SQLGetData. I have hacked my way 
around these problems, but the fixes are not very elegant ...

1)
SqlGetData:
The target column's type is SQL_LONGVARBINARY (other binary fields might 
do as well), and you try to get them as SQL_C_CHAR. This return the data 
in binary format, instead of ASCII characters as hexadecimal form 
(11111111 -> FF).

2)
SqlGetData:
The target column's type is SQL_DATE or SQL_TIMESTAMP, and you try to 
get them as SQL_C_CHAR. This will cause successive calls to SQLGetData 
to return the same value repeatedly. This results non-ending loop in the 
following code, as value of got is constantly above zero. Note: 
st.GetData is wrapper around SQLGetData.

while( (got=st.GetData( i, buf, sizeof(buf), SQL_C_CHAR ))>0 )
	line.append( buf );


-- 
Mika Mäntylä            || SoberIT
+358 9 451 6001         || Spektri Kvartti 3330a
				


Responses

pgsql-odbc by date

Next:From: Denis GasparinDate: 2001-10-23 13:52:56
Subject: Re: [ODBC] Writing BLOBS to pgsql via ODBC using VB
Previous:From: Hiroshi InoueDate: 2001-10-23 05:19:50
Subject: Re: [ODBC] Writing BLOBS to pgsql via ODBC using VB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group