Difference between revisions of "SET TIMESTAMP"

From Lianjapedia
Jump to: navigation, search
(Description)
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
  
 
==Syntax==
 
==Syntax==
SET TIMESTAMP TO <fieldname>
+
SET TIMESTAMP TO [<fieldname>]
  
 
==See Also==
 
==See Also==
Line 9: Line 9:
  
 
==Description==
 
==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.
+
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.  Issuing the SET TIMESTAMP TO command with no <fieldname> specified, disables the insert.
  
 
==Example==
 
==Example==
Line 26: Line 26:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Set Commands|TIMESTAMP]]
 
[[Category:Set Commands|TIMESTAMP]]
[[Category:Databases]]
+
[[Category:NoSQL Commands]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Command Extensions]]

Latest revision as of 12:00, 10 March 2017

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 BLANK, CLEAR TIMELINE, LIST TIMELINE, ROLLBACK TIMELINE, INSERT, SET TIMELINE, SYSTIMELINE, TIME(), TIMELINE(), 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. Issuing the SET TIMESTAMP TO command with no <fieldname> specified, disables the insert.

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")