Function Reference > Functions > SYSTIMESTAMP
  

SYSTIMESTAMP

Returns the current date and time with precision to the nanosecond of the system that hosts the Secure Agent that starts the task. The precision to which you can retrieve the date and time depends on the system that hosts the Secure Agent.

Syntax

SYSTIMESTAMP( [format] )
Argument
Required/
Optional
Description
format
Optional
Precision to which you want to retrieve the timestamp. You can specify precision up to seconds (SS), milliseconds (MS), microseconds (US), or nanoseconds (NS). Enclose the format string within single quotation marks. The format string is not case sensitive. For example, to display the date and time to the precision of milliseconds use the following syntax: SYSTIMESTAMP(‘MS’). Default precision is microseconds (US).

Return Value

Timestamp. Returns date and time to the specified precision. Precision dependent on platform.

Examples

Your organization has an online order service and processes real-time data. You can use the SYSTIMESTAMP function to generate a primary key for each transaction in the target.
Create a task with the following field mappings:
Source Column
Target Column
Expression
Customer_Name
Customer_Name
n/a
Order_Qty
Order_Qty
n/a
Transaction_Id
SYSTIMESTAMP (SS)
At run time, the SYSTIMESTAMP generates the system time to the precision of microseconds for each row:
Customer_Name
Order_Qty
Transaction_Id
Vani Deed
14
07/06/2007 18:00:30
Kalia Crop
3
07/06/2007 18:00:30
Vani Deed
6
07/06/2007 18:00:31
Harry Spoon
32
07/06/2007 18:00:31