Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Sybase DB Library C 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

  1                       Version 4.0 -- 5/1/89                  dbtsput
  ______________________________________________________________________

  NAME:  dbtsput

  FUNCTION:
       Put the new value of the timestamp column into the given  table's
       current row in the DBPROCESS.

  SYNTAX:
       RETCODE dbtsput(dbproc, newts, newtslen, tabnum, tabname)

       DBPROCESS *dbproc;
       DBBINARY  *newts;
       int       newtslen;







  dbtsput                 Version 4.0 -- 5/1/89                        2
  ______________________________________________________________________
       int       tabnum;
       char      *tabname;

  COMMENTS:

       o dbtsput() is one of the DB-Library browse mode  routines.   See
         the Introduction for a detailed discussion of browse mode.
       o 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 state-
         ment,  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


  3                       Version 4.0 -- 5/1/89                  dbtsput
  ______________________________________________________________________
         update the row a second time, it can call dbqual() to formulate
         a new WHERE clause that uses the new timestamp.

  PARAMETERS:
       dbproc -  A pointer to the DBPROCESS structure that provides  the
           connection for a particular front-end/SQL Server process.  It
           contains all the information that DB-Library uses  to  manage
           communications and data between the front end and SQL Server.

           This must be the  DBPROCESS  used  to  perform  the  original
           SELECT query.
       newts -  A pointer to the new timestamp value.  It is returned by
           dbtsnewval().
       newtslen -  The  length  of  the  new  timestamp  value.   It  is
           returned by dbtsnewlen().
       tabnum -  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.


  dbtsput                 Version 4.0 -- 5/1/89                        4
  ______________________________________________________________________
           If this value is -1, the tabname parameter will  be  used  to
           identify the table.
       tabname -  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.

  RETURNS:
       SUCCEED or FAIL.  The following situations will cause  this  rou-
       tine to return FAIL:

       o The application tries to update the timestamp of a non-existent
         row.
       o The application tries to update the timestamp using NULL as the
         timestamp value (newts).

       o The specified table is non-browsable.




  5                       Version 4.0 -- 5/1/89                  dbtsput
  ______________________________________________________________________

  SEE ALSO:
       dbcolbrowse, dbcolsource, dbqual, dbtabbrowse, dbtabcount, dbtab-
       name, dbtabsource, dbtsnewlen, dbtsnewval















Typewritten Software • bear@typewritten.org • Edmonds, WA 98026