Put the new value of the timestamp column into the given table’s current row in the DBPROCESS.
RETCODE dbtsput(dbproc, newts, newtslen, tabnum, tabname) DBPROCESS *dbproc; DBBINARY *newts; int newtslen; int tabnum; char *tabname;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
This must be the DBPROCESS used to perform the original select query.
A pointer to the new timestamp value. It is returned by dbtsnewval.
The length of the new timestamp value. It is returned by dbtsnewlen.
The number of the updated table. Table numbers start at 1. tabnum must refer to a browsable table. Use dbtabbrowse to determine whether a table is browsable.
If this value is -1, the tabname parameter will be used to identify the table.
A pointer to a null-terminated table name. tabname must refer to a browsable table. If this pointer is NULL, the tabnum parameter will be used to identify the table.
SUCCEED or FAIL.
The following situations will cause this routine to return FAIL:
The application tries to update the timestamp of a non-existent row.
The application tries to update the timestamp using NULL as the timestamp value (newts).
The specified table is non-browsable.
dbtsput is one of the DB-Library browse-mode routines. See “Browse mode” for a detailed discussion of browse mode.
dbtsput manipulates the timestamp column. The where clause returned by dbqual contains a call to the tsequal built-in function. When such a where clause is used in an update statement, the tsequal function places a new value in the updated row’s timestamp column and returns the new timestamp value to the application (if the update is successful). If the same row is updated a second time, the update statement’s where clause must use the latest timestamp value.
This routine updates the timestamp in the DBPROCESS for the row currently being browsed. Then, if the application needs to update the row a second time, it can call dbqual to formulate a new where clause that uses the new timestamp.
dbcolbrowse, dbcolsource, dbqual, dbtabbrowse, dbtabcount, dbtabname, dbtabsource, dbtsnewlen, dbtsnewval