Known Issues for SAP Adaptive Server Enterprise ODBC Driver

Known problems and workarounds, if any, for SAP Adaptive Server Enterprise ODBC Driver.

SAP Adaptive Server Enterprise ODBC Driver issues
CR# Description
682086

The bulk insert functionality of the ODBC Driver available with SQLBulkOperations has not been tested with large object (LOB) columns marked for in-row storage on allpages-locked (APL) tables. Using this API against such APL tables could result in errors or corrupted data.

Workaround: Do not mark LOB columns for in-row storage on APL tables if you are using SQLBulkOperations to bulk load data into the tables.

You see an error if you do not specify the precision and scale using the ODBC API method – SQLSetDescField – when retrieving data from numeric or decimal columns in a table.

Workaround: Specify the SQLSetDescField with value types SQL_DESC_PRECISION and SQL_DESC_SCALE.

This code illustrates how to retrieve a numeric column from a table specifying a precision and scale.

/*
Insert values
Execute select statement
*/

/*
Fetch Values
*/

#define ROW_SIZE 10
SQLRETURN sr;
SQL_NUMERIC_STRUCT      g[ROW_SIZE];
SQLLEN  gLen[ROW_SIZE];
SQLINTEGER intVal[ROW_SIZE];
SQLLEN intLen[ROW_SIZE];;

sr = SQLBindCol(hStmt, 1, SQL_C_LONG, intVal, sizeof(SQLINTEGER), intLen);
sr = SQLBindCol(hStmt, 2, SQL_C_NUMERIC, g, sizeof(SQL_NUMERIC_STRUCT), gLen);

SQLHDESC hdesc = NULL;
SQLGetStmtAttr(hStmt, SQL_ATTR_APP_ROW_DESC, &hdesc, 0, NULL);
SQLSetDescField(hdesc, 2, SQL_DESC_PRECISION, SQLPOINTER) 5, 0);
SQLSetDescField(hdesc, 2, SQL_DESC_SCALE, (SQLPOINTER) 2, 0);
SQLUSMALLINT rowStatus[ROW_SIZE];

sr = SQLSetStmtAttr(hStmt, SQL_ATTR_ROW_STATUS_PTR, rowStatus, 0);
for (short i = 0; i < ROW_SIZE; i++)
{
	 memset(&g[i], '\0', sizeof(SQL_NUMERIC_STRUCT));
	 memset(g[i].val, 0, 16);
}
sr = SQLFetch(StatementHandle);

See the Microsoft ODBC API Reference at http://msdn.microsoft.com/en-us/library/ms713560%28v=VS.85%29.aspx.