GetDataLobNoTotal CLI/ODBC and IBM data server driver configuration keyword

Causes SQLGetData() to fetch column data in pieces of specified size (in bytes) instead of fetching column data all at once.

db2cli.ini keyword syntax:
GetDataLobNoTotal = positive integer
IBM® data server driver configuration file (db2dsdriver.cfg) syntax:
<parameter name="GetDataLobNoTotal" value="positive integer"/>
Attention: The IBM data server driver configuration file (db2dsdriver.cfg) syntax is available in Db2 11.5.4 and later.
Usage notes:

SQLGetData() retrieves data for a single column in the current row of the result set. The first call to SQLGetData() results in following tasks:

  • Fetches all the data from the database server to the client, which requires allocating memory on the client for the data
  • Applies a code page conversion to that data, if required
  • Calculates the total length of the converted data
  • Returns the length of the converted data to the client application

When the data is large, allocating memory for the data on the client might fail. You can avoid this potential memory allocation problem, by using the GetDataLobNoTotal keyword.

When you set the GetDataLobNoTotal keyword, SQLGetData() does not fetch all the data for the given column on the first call. Instead, SQLGetData() fetches enough data to fill the buffer on the client, as specified by the value of GetDataLobNoTotal, and returns SQL_NO_TOTAL (-4) if there is more data to be fetched from the server. You can call SQLGetData() as many times as needed to fetch all the data. When all the data has been fetched, SQLGetData() returns SQL_SUCCESS and the size of the last data chunk.