home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbtsput.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.6 KB  |  86 lines

  1. .Na "dbtsput"
  2. .mc |
  3. .Aa
  4. .Fu
  5. Put the new value of the timestamp column 
  6. into the given table's current row in the DBPROCESS.
  7. .Ih "timestamp column, putting new value into DBPROCESS (browse mode)"
  8. .Sy
  9. .Sf "RETCODE dbtsput(dbproc, newts, newtslen, tabnum, tabname)"
  10. .Sp "DBPROCESS" "*dbproc"
  11. .Sp "DBBINARY" "*newts"
  12. .Sp "int" "newtslen"
  13. .Sp "int" "tabnum"
  14. .Sp "char" "*tabname"
  15. .Co
  16. .Bl
  17. \f2dbtsput()\f1 is one of the \*L browse mode routines.
  18. See the Introduction for a detailed discussion of browse mode.
  19. .Bl
  20. \f2dbtsput()\f1 manipulates the timestamp column.
  21. The WHERE clause returned by \f2dbqual()\f1 contains a call to the
  22. \f2tsequal\f1 built-in function.
  23. .Ih "tsequal function"
  24. When such a WHERE clause is used in an UPDATE statement,
  25. the \f2tsequal\f1 function places a new value in
  26. the updated row's timestamp column and returns the new timestamp value
  27. to the application (if the update is successful).
  28. If the same row is updated a second time,
  29. the UPDATE statement's WHERE clause
  30. must use the latest timestamp value.
  31. .sp 0.5v
  32. This routine updates the timestamp in the DBPROCESS for the row currently being browsed.
  33. Then, if the application needs to update the row a second time, it can call
  34. \f2dbqual()\f1 to formulate a new WHERE clause that uses the new timestamp.
  35. .Bz
  36. .Pa
  37. .Pi dbproc
  38. A pointer to the DBPROCESS structure that provides the connection
  39. for a particular front-end/\*S process.  It contains all the
  40. information that \*L uses to manage communications and data between the
  41. front end and \*S.
  42. .sp 0.5v
  43. This must be the DBPROCESS used to perform the original SELECT query.
  44. .Pi newts 
  45. A pointer to the new timestamp value.
  46. It is returned by
  47. \f2dbtsnewval()\f1.
  48. .Pi newtslen
  49. The length of the new timestamp value.
  50. It is returned by
  51. \f2dbtsnewlen()\f1.
  52. .Pi tabnum
  53. The number of the updated table. Table numbers start
  54. at 1. 
  55. \f2tabnum\f1 must refer to a browsable table.
  56. Use \f2dbtabbrowse()\f1 to determine whether a table is browsable.
  57. .sp 0.5v
  58. If this value is -1, the \f2tabname\f1 parameter will be used to identify the table.
  59. .Pi tabname
  60. A pointer to a null-terminated table name.
  61. \f2tabname\f1 must refer to a browsable table.
  62. If this pointer is NULL, the \f2tabnum\f1 parameter will be used to identify the table.
  63. .in -.375i
  64. .Re
  65. .br
  66. SUCCEED or FAIL.
  67. The following situations will cause this routine to return FAIL:
  68. .Bl
  69. The application tries to update the timestamp of a non-existent row.
  70. .Bl
  71. The application tries to update the timestamp using NULL as the timestamp value (\f2newts\f1).
  72. .Bl
  73. The specified table is non-browsable.
  74. .Bz
  75. .Sa
  76. dbcolbrowse,
  77. dbcolsource,
  78. dbqual,
  79. dbtabbrowse,
  80. dbtabcount,
  81. dbtabname,
  82. dbtabsource,
  83. dbtsnewlen,
  84. dbtsnewval
  85. .mc
  86.