Top

Name

now — returns the current transaction timestamp

Synopsis

now ( );
 

Description

Now returns the timestamp associated with current transaction as a DATETIME . This value is guaranteed to differ from the timestamp of any other transaction.

Examples

Example 24.227. Get a timestamp

Get a timestamp in human-readable form.

SQL> select datestring(now()), cast (now() as VARCHAR);
callret                   callret
VARCHAR                   VARCHAR
_______________________________________________________________________________

2001-10-08 16:31:49.000000  2001-10-08 16:31:49.000000

1 Rows. -- 99 msec.


Example 24.228. Table example

Store update time in a column

SQL> update test_table set TIME_CHANGED = now();

Done. -- 37 msec.
SQL> select cast (TIME_CHANGED as VARCHAR) from test_table;
callret
VARCHAR
_______________________________________________________________________________

2001-10-08 16:34:28.000000

1 Rows. -- 3 msec.


Parameters

now has no parameters.

Return Types

A DATETIME timestamp.

Errors

now does not return errors.