Difference between revisions of "SET TIMESTAMP"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Enable a timestamp to be inserted into the specified field as a record is being appended | Enable a timestamp to be inserted into the specified field as a record is being appended | ||
Line 10: | Line 8: | ||
==See Also== | ==See Also== | ||
− | [[CLEAR TIMELINE]], [[LIST TIMELINE]], [[ROLLBACK TIMELINE]], [[SET TIMELINE]], [[SYSTIMELINE]] | + | [[APPEND]], [[CLEAR TIMELINE]], [[LIST TIMELINE]], [[ROLLBACK TIMELINE]], [[SQL INSERT|INSERT]], [[SET TIMELINE]], [[SYSTIMELINE]], [[TIME()]], [[TIMEOFDAY()]] |
==Description== | ==Description== | ||
− | The SET TIMESTAMP command | + | The SET TIMESTAMP command defines a field in the current table to be used as a timestamp. When records are subsequently added to the table, the current system time will be inserted into the <fieldname> field. |
==Example== | ==Example== | ||
− | set timestamp to | + | <code lang="recital"> |
+ | open database southwind | ||
+ | alter table example add column timeref char(8) | ||
+ | use example | ||
+ | set timestamp to timeref | ||
+ | // timeref field will be populated with current system time | ||
+ | append blank | ||
+ | use | ||
+ | // timeref field will be populated with current system time | ||
+ | insert into example (account_no, last_name) values ("99999", "Smith") | ||
+ | </code> | ||
Line 24: | Line 32: | ||
Recital, Recital Server | Recital, Recital Server | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
− | [[Category:Set Commands]] | + | [[Category:Set Commands|TIMESTAMP]] |
[[Category:Database Timelines]] | [[Category:Database Timelines]] | ||
− |
Latest revision as of 08:56, 6 July 2011
Purpose
Enable a timestamp to be inserted into the specified field as a record is being appended
Syntax
SET TIMESTAMP TO <fieldname>
See Also
APPEND, CLEAR TIMELINE, LIST TIMELINE, ROLLBACK TIMELINE, INSERT, SET TIMELINE, SYSTIMELINE, TIME(), TIMEOFDAY()
Description
The SET TIMESTAMP command defines a field in the current table to be used as a timestamp. When records are subsequently added to the table, the current system time will be inserted into the <fieldname> field.
Example
open database southwind alter table example add column timeref char(8) use example set timestamp to timeref // timeref field will be populated with current system time append blank use // timeref field will be populated with current system time insert into example (account_no, last_name) values ("99999", "Smith")
Products
Recital, Recital Server