Default buffer size

The client application sends the prepared statement that is associated with the cursor to the database server and requests DESCRIBE information about the statement. If the cursor has an associated prepared statement, Informix® ESQL/C makes this request when the PREPARE statement executes. If the cursor does not have an associated statement, Informix ESQL/C makes the request when the DECLARE statement executes.

When it receives this request, the database server sends the DESCRIBE information about each column in the projection list to the application. With this information, Informix ESQL/C can determine the size of a row of data. By default, Informix ESQL/C sizes this cursor buffer to hold one row of data. It uses the following algorithm to determine the default size of the cursor buffer:
  1. If one row fits in a 4096-byte buffer, the default buffer size is 4096 bytes (4 kilobytes).
  2. If the size of one row exceeds 4096 bytes, the default buffer size is the size of that row.

Once it has the buffer size, Informix ESQL/C allocates the cursor buffer.