Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

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.
The return value of the function varies depending on how you configure the argument:
  • When you configure the argument of SYSTIMESTAMP as a variable,
    Data Integration
    evaluates the function for each row in the transformation.
  • When you configure the argument of SYSTIMESTAMP as a constant,
    Data Integration
    evaluates the function once and retains the value for each row in the transformation.

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 database.
Create an Expression transformation with the following fields and values:
Field Name
Field Type
Expression
Customer_Name
Input
n/a
Order_Qty
Input
n/a
Time_Counter
Variable
'US'
Transaction_ID
Output
SYSTIMESTAMP (Time_Counter)
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.701015000
Kalia Crop
3
07/06/2007 18:00:30.701029000
Vani Deed
6
07/06/2007 18:00:30.701039000
Harry Spoon
32
07/06/2007 18:00:30.701048000

0 COMMENTS

We’d like to hear from you!