SQL Getting Started
A special register is a storage area that is defined for a
connection by the database manager and is used to store information that can
be referenced in SQL statements. Following are a few examples of the
more commonly used special registers. For a list of all the special
registers and more detailed information refer to the SQL
Reference.
- CURRENT DATE: Holds the date according to the time-of-day clock at
SQL statement execution time.
- CURRENT FUNCTION PATH: Holds a value that specifies the function
path used to resolve function and data type references.
- CURRENT SERVER: Specifies the current application server.
- CURRENT TIME: Holds the time according to the time-of-day clock at
the SQL statement execution time.
- CURRENT TIMESTAMP: Specifies a timestamp according to the
time-of-day clock at SQL statement execution time.
- CURRENT TIMEZONE: Specifies the difference between Coordinated
Universal Time and local time at the application server.
- USER: Specifies the run-time authorization ID.
You can display the contents of a special register with the VALUES
statement. For example:
VALUES (CURRENT TIMESTAMP)
You could also use:
SELECT CURRENT TIMESTAMP FROM ORG
and this will return the TIMESTAMP for every row entry in the
table.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]