DB Library for C

DB Library for C


Returns the new value of a text timestamp after a call to dbwritetext.


LPCDBBINARY dbtxtsnewval ( PDBPROCESS dbproc );



Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000 process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.


A pointer to the new text timestamp value for the SQLTEXT or SQLIMAGE value modified by a dbwritetext operation. This pointer can be NULL.

Caution  Do not modify this identifier in any way. Modifying the identifier can cause unpredictable results.


Every database column of type SQLTEXT or SQLIMAGE has an associated text timestamp, which is updated whenever the column's value is changed. Use the text timestamp with dbwritetext to ensure that one user doesn't inadvertently overwrite another's modifications to the same value in the database. It is returned to the DBPROCESS when a Transact-SQL SELECT statement is performed on a SQLTEXT or SQLIMAGE column and can be examined by calling dbtxtimestamp.

After each successful dbwritetext operation (which can include a number of calls to dbmoretext), SQL Server sends the updated text timestamp value back to DB-Library. The dbtxtsnewval function lets the application get this new timestamp value. The application can then use dbtxtsput to put the new timestamp value in the DBPROCESS for future access through dbtxtimestamp.

The application can use dbtxtsnewval in two ways. First, the return from dbtxtsnewval can be used as the timestamp parameter of a dbwritetext call. Second, dbtxtsnewval and dbtxtsput can be used together to put the new timestamp value into the DBPROCESS row buffer for future access using dbtxtimestamp. This is particularly useful when the application is buffering result rows and does not need the new timestamp immediately.

See Also