pyuser
unread,Feb 22, 2012, 4:55:46 AM2/22/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi All,
Im facing a problem in fetching image, varbinary data. Details given
below.
When I try to fetch image, varbinary data from a table created in
Sybase ASE 15.7 (Developer edition) on Windows 7 64bit using ODBC
driver (version:15.7.0.80, ODBC version:3.51), I get NULL data in data
buffer.
Data can be seen in "Interactive SQL" window opened from "Sybase
Central" tool.
My ODBC (C++) application (64bit) on Windows 7 has following sequence
of actions to fetch this image data:
// prepare query:
wchar_t *query = _T("select * from mytable NOLOCK;");
SQLRETURN ret = 0;
ret = SQLPrepare(stmt, query, SQL_NTS);
if (!SQL_SUCCEEDED(ret))
{
TRACE("SybAse:SQLprepare failed.");
DbException::sqlErrorInfo(SQL_HANDLE_STMT, stmt);
throw DbException(std::string(""));
}
// bind to column:
SQLBindCol(stmtHdl, columnNumber, SQL_C_BINARY,
m_colValue[0], m_len, &m_LenInd[0]);
// Execute query:
ret = SQLExecute(stmt);
// fetch rows
if (SQL_SUCCESS == ret || SQL_SUCCESS_WITH_INFO == ret)
{
do {
ret = SQLFetchScroll(m_stmt, SQL_FETCH_NEXT, 0);
// handle data per row here...
} while(SQL_SUCCEEDED(ret));
}
Can you please help me know if there are any options that I need to
set when doing select of image, varbinary columns from ODBC?
Thanks in advance for the help.