Updates an existing text or image value. Unlike dbwritetext which replaces an entire text or image value, dbupdatetext can change only a portion of a text or image value in place.
RETCODE dbupdatetext (
PDBPROCESS pdbproc,
LPCSTR dest_object,
LPCDBBINARY dest_textptr,
LPCDBBINARY dest_timestamp,
INT update_type,
DBINT insert_offset,
DBINT delete_length,
LPCSTR src_object,
DBINT src_size,
LPCBYTE src_text );
Use UT_TEXT to insert new data from a C program variable specified in this call to dbupdatetext. You must specify an src_object value of NULL, an src_size equal to the size in bytes of the new data value being inserted, and a non-NULL src_text that points to the C program variable that contains the new data value being inserted.
Use UT_MORETEXT to insert new data from a C program variable with later calls to dbmoretext. You must specify a src_object value of NULL, a src_size equal to the total size in bytes of the new data value (that will be inserted by calls to dbmoretext), and a src_text value of NULL. Then call dbmoretext to insert the new data value in chunks.
Use UT_TEXTPTR to insert new data from a text or image column of an existing table. You must specify a non-NULL src_object value that gives the table and column, a src_size of 0, and a non-NULL src_text that gives the text pointer (returned by dbtxptr) of the new data value being inserted from the src_object.
Use UT_DELETEONLY to only delete existing data. You must specify an insert_offset value other than -1 and a nonzero delete_length value. Specify that no new data be inserted by using a src_object value of NULL, a src_size of 0 and a src_text value of NULL.
By default, a dbupdatetext operation is not recorded in the transaction log. You can join the UT_LOG bit flag in a bitwise OR with any of these update_type values (for example UT_TEXT | UT_LOG) to indicate that this operation will be recorded in the transaction log.
SUCCEED or FAIL.
The dbupdatetext function can be used to delete existing data and then insert new data, to delete only existing data, or to insert only new data.
To delete existing data and then insert new data, specify an update_type other than UT_DELETEONLY, an insert_offset value other than -1, a nonzero delete_length value, and the new data to be inserted.
To delete only existing data, specify an update_type value of UT_DELETEONLY, an insert_offset value other than -1 and a nonzero delete_length value. Do not specify any new data to be inserted.
To insert only new data, specify an update_type other than UT_DELETEONLY, a delete_length value of 0, and the new data to be inserted.
dbmoretext | dbtxptr |
dbreadtext | dbtxtimestamp |
dbresults | dbtxtsnewval |
dbsqlok |