Hi,
I am trying to download image/blob data from MS SQL Server to Solaris via Merant ODBC.
I first connected and allocated statement handle. Then called
ret = SQLExecDirect(hstmt,"select blob from MyTbl where id = 1",SQL_NTS);
(ret = SQL_SUCCESS returned).
I then do SQLFetch()
while((ret = SQLFetch(hstmt)) != SQL_NO_DATA) { ...... }
Now the problem comes: the very first call to SQLFetch() failed with the following error:
ret = SQL_ERROR
ErrState = 22003
ErrMsg: [MERANT][ODBC SQL Server Driver]Numeric value out of range
I then put a call
ret = SQLDescribeCol() between SQLExecDirect() and SQLFetch(),
this call returned all the correct info:
ColName = "blob",
ColNameBuffLen = 4,
ColType = SQL_LONGVARBINARY,
ColSize = 566 Bytes
DecimalDigits = 0,
Nullable = 1,
which means the ODBC driver had the correct knowledge of the nature of the image/blob column. So the question is why SQLFetch() failed with the message "Numeric value out of range", there are no numeric value involved at all.
Any help would be greatly appreciated.
Siqian He
he@ncbi.nlm.nih.gov
I am trying to download image/blob data from MS SQL Server to Solaris via Merant ODBC.
I first connected and allocated statement handle. Then called
ret = SQLExecDirect(hstmt,"select blob from MyTbl where id = 1",SQL_NTS);
(ret = SQL_SUCCESS returned).
I then do SQLFetch()
while((ret = SQLFetch(hstmt)) != SQL_NO_DATA) { ...... }
Now the problem comes: the very first call to SQLFetch() failed with the following error:
ret = SQL_ERROR
ErrState = 22003
ErrMsg: [MERANT][ODBC SQL Server Driver]Numeric value out of range
I then put a call
ret = SQLDescribeCol() between SQLExecDirect() and SQLFetch(),
this call returned all the correct info:
ColName = "blob",
ColNameBuffLen = 4,
ColType = SQL_LONGVARBINARY,
ColSize = 566 Bytes
DecimalDigits = 0,
Nullable = 1,
which means the ODBC driver had the correct knowledge of the nature of the image/blob column. So the question is why SQLFetch() failed with the message "Numeric value out of range", there are no numeric value involved at all.
Any help would be greatly appreciated.
Siqian He
he@ncbi.nlm.nih.gov