Text or image columns are updated three ways:
Embed the new value in the text of an update language command. The advantage of this method is simplicity. The disadvantage is that the application must send the entire value at once. This method may not be appropriate for very large columns (that is, larger than the program can allocate space for). Adaptive Server Enterprise requires the value to be embedded in the command text, and not passed as a command parameter. Adaptive Server Enterprise does not allow parameters of type text or image.
Initiate a send-data command (with ct_command) and send the value in chunks with ct_send_data). This method handles values that are larger than the program’s buffer space, but it is more complicated. This method may be more natural than the embedded method for applications that read the value in chunks from an external source such as an operating system file.
Initiate the send-data command by calling the ct_command routine with the type parameter set to CS_SEND_DATA_NOCMD. The client application can then use send-data commands to send only text or image data to the server bulk handler. When a bulk event occurs at the server, a 4-byte field is sent indicating the total number of bytes to be sent, followed by the text or image data. The bulk handler reads the total number of bytes expected using srv_text_info and the data using srv_get_data.
To update a text or image column in this way, the CS_SENDDATA_NOCMD connection property—not to be confused with the CS_SEND_DATA_NOCMD setting of ct_command type parameter—must be set before the ct_connect routine is called.
An application only updates a text or image column using ct_send_data if it has defined (using ct_data_info) current I/O descriptor settings for the column that it intends to update. The I/O descriptor settings are contained in a CS_IODESC structure. (See “CS_IODESC structure”.) Adaptive Server Enterprise requires a correctly initialized I/O descriptor to perform the update, and the client application must retrieve the required I/O descriptor settings from the server.