Oracle / PLSQL: SYSTIMESTAMP function

This article is written about how to use the Oracle/PLSQL SYSTIMESTAMP function with syntax and examples.

Description

The Oracle/PLSQL SYSTIMESTAMP characteristic returns the contemporary gadget date and time (including fractional seconds and time zone) on your nearby database.

Syntax

The syntax for the SYSTIMESTAMP function in Oracle/PLSQL is:

SYSTIMESTAMP

Parameters or Arguments

There are no parameters or arguments for the SYSTIMESTAMP function.

Returns

The SYSTIMESTAMP characteristic returns a TIMESTAMP WITH TIME ZONE value.

Applies To

The SYSTIMESTAMP function can be used in the following versions of Oracle/PLSQL:

Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i

Example

Let’s seem to be at some Oracle SYSTIMESTAMP function examples and explore how to use the SYSTIMESTAMP characteristic in Oracle/PLSQL.

For example:

SELECT SYSTIMESTAMP
INTO v_time
FROM dual;

The variable referred to as v_time will now incorporate the date and time (including fractional seconds and time zone) at the moment the command is executed.

The SYSTIMESTAMP characteristic might return a value like this:

2015-07-22 10:35:07.417849 -06:00

You can also pick out to use the TO_CHAR feature with the SYSTIMESTAMP function.

For example:

SELECT TO_CHAR(SYSTIMESTAMP, 'SSSS.FF')
FROM dual;

The function above may return a value such as:

4141.550774

You may want to additionally use the SYSTIMESTAMP feature in any SQL statement.

For example:

SELECT supplier_id, SYSTIMESTAMP
FROM suppliers
WHERE supplier_id > 5000;