SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-37
CURRENT_TIMESTAMP Function
CURRENT_TIMESTAMP Function
The CURRENT_TIMESTAMP function returns a value of type TIMESTAMP based on
the current local date and time. You can also use the CURRENT Function on
page 9-34.
precision
is an integer value in the range 0 to 6 that specifies the precision of (the number of
decimal places in) the fractional seconds in the returned value. The default is 6.
For example, the function CURRENT_TIMESTAMP (2) returns the current date
and time as a value of data type TIMESTAMP, where the precision of the fractional
seconds is 2; for example, 1997-06-26 09:01:20.89. The value returned is not a
string value.
Examples of CURRENT_TIMESTAMP
The PROJECT table contains a column SHIP_TIMESTAMP of data type
TIMESTAMP. Update a row by using the CURRENT_TIMESTAMP value:
UPDATE persnl.project
SET ship_timestamp = CURRENT_TIMESTAMP
WHERE projcode = 1000;
CURRENT_USER Function
The CURRENT_USER function returns the current Guardian user ID as variable-length
character data in the form group.name.
The CURRENT_USER function is equivalent to the SESSION_USER Function on
page 9-139 and the USER Function on page 9-165.
Examples of CURRENT_USER
Retrieve the user name value for the current user:
SELECT CURRENT_USER FROM logfile;
(EXPR)
-----------------------
DCS.TSHAW
...
--- 5 row(s) selected.
CURRENT_TIMESTAMP [(precision)]
CURRENT_USER