Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Time functions

Time functions determine following data

  • current date (CURRENT_DATE)

  • current time (CURRENT_TIME(3) or LOCALTIME(3))

  • time stamp with the current date and current time (CURRENT_TIMESTAMP(3) or LOCALTIMESTAMP(3))

  • date corresponding to an integer value (DATE_OF_JULIAN_DAY) (see also the inverse function JULIAN_DAY_OF_DATE on "JULIAN_DAY_OF_DATE() - Convert date").


LOCALTIMESTAMP(3) and CURRENT_TIMESTAMP(3) are equivalent in SESAM/SQL, as are LOCALTIME(3) and CURRENT_TIME(3).



time_function ::=

{
   CURRENT_DATE |
   CURRENT_TIME(3) |
   LOCALTIME(3) |
   CURRENT_TIMESTAMP(3) |
   LOCALTIMESTAMP(3) |
   DATE_OF_JULIAN_DAY( expression )
}



expression

Numeric integer value which SESAM/SQL interprets as a Julian day number. expression may not be a multiple value with dimension > 1.


If the time functions CURRENT_DATE, CURRENT_TIME(3), LOCALTIME(3), CURRENT_TIMESTAMP(3) and LOCALTIMESTAMP(3) are included in a statement multiple times, they are executed simultaneously. This also applies for all time functions that are evaluated as the result of the statement:

  • time functions in the DEFAULT clause of the column definition if the default value is used

  • time functions that occur in the SELECT expression of a view or temporary view if the view or temporary view is referenced

All the values that are returned have the same data and/or time. Therefore, you cannot use time functions to determine execution times within a statement.

Time functions in dynamic statements and in cursor descriptions are evaluated when the EXECUTE, EXECUTE IMMEDIATE or OPEN statement is performed.