Client-Library’s CS_IODESC structure

The CS_IODESC structure describes text or image data.

When retrieving text or image data from a column that will be updated, a Client-Library application calls ct_data_info to get the CS_IODESC structure that describes the text or image column.

Generally an application must call ct_get_data for the column before calling ct_data_info. However, when ct_get_data is used with Server-Library API srv_send_data, to transfer text, image, and XML columns in chunks in Gateway Open Server applications, call ct_data_info before calling ct_get_data.

If you do not need to retrieve the column’s data, assign 0 to buflen in ct_get_data. This technique is useful for determining the length of a text or image value before retrieving it.

For more information, see the Open Server Server-Library/C Reference Manual.

When updating the column, the application calls ct_data_info again to apply the CS_IODESC fields for the update operation.

DB-Library has specialized routines for manipulating the text timestamp for a column or value. In Client-Library, applications handle these tasks by calling ct_data_info and then modifying the resulting CS_IODESC structure directly.

A typical application only modifies three fields of a CS_IODESC structure before using it in an update operation:

The timestamp field in CS_IODESC marks the time of a text or image column’s last modification.

Table 6-5 compares text timestamp functionality in DB-Library and Client-Library:

Table 6-5: DB-Library vs. Client-Library—text timestamps

DB-Library routines

DB-Library functionality

Client-Library equivalent

dbtxtimestamp(dbproc, column)

Return the value of the text timestamp for a column in the current row

Retrieve the I/O descriptor for a column in the current row and put it into CS_IODESC:

ct_data_info(cmd, CS_GET, colnum, iodesc).

The text timestamp is in CS_IODESC → timestamp.

dbtxptr(dbproc,column)

Return the value of the text pointer for a column in the current row

The text pointer is in CS_IODESC → textptr.

dbtxtsnewval(dbproc)

Return the new value of a text timestamp after a call to dbwritetext

Process the return parameter result set (ct_results returns with result_type of CS_PARAM_RESULT), which contains the new text timestamp value after a call to ct_send_data.