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.
The application must call ct_get_data for the column before calling ct_data_info. If you do not need to retrieve the column’s data, you can code the ct_get_data call with a buflen of 0. This technique is useful for determining the length of a text or image value before retrieving it.
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:
total_txtlen
This field specifies the total length, in bytes, of the new value. This is equivalent to the size parameter to dbwritetext.
log_on_update
This field indicates whether or not the server should log the update. This is equivalent to the log parameter to dbwritetext.
locale
This field points to a CS_LOCALE structure containing localization information for the value, if any. It has no equivalent in DB-Library.
The timestamp field in CS_IODESC marks the time of a text or image column’s last modification.
The following table compares text timestamp functionality in DB-Library and Client-Library:
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 |
dbtxptr( dbproc, column) |
Return the value of the text pointer for a column in the current row |
The text pointer is in |
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. |