Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere C API reference » sacapi.h


sqlany_get_column function

Fills the supplied buffer with the value fetched for the specified column.

sacapi_bool sqlany_get_column( a_sqlany_stmt * stmt, sacapi_u32 col_index,
  a_sqlany_data_value * value )
  • stmt   A statement object that was executed by sqlany_execute or sqlany_execute_direct.

  • col_index   The number of the column to be retrieved. A column number is between 0 and sqlany_num_cols() - 1.

  • value   The a_sqlany_data_value object to be filled with the data fetched for column col_index.


For A_BINARY and A_STRING * data types, value->buffer points to an internal buffer associated with the result set. Do not rely upon or alter the content of the pointer buffer as it changes when a new row is fetched or when the result set object is freed. Copy the data from the pointers into the buffers.

The length field indicates the number of valid characters that value->buffer points to. The data returned in value->buffer is not null-terminated. This function fetches all the returned values from the SQL Anywhere database server. For example, if a column contains a 2 GB blob, the sqlany_get_column function attempts to allocate enough memory to hold that value. If you do not want to allocate memory, use sqlany_get_data.


1 on success or 0 for failure. A failure can happen if any of the parameters are invalid or if there is not enough memory to retrieve the full value from the SQL Anywhere database server.

See also