DB2 Version 9.7 for Linux, UNIX, and Windows

DUAL table

The DB2® data server resolves any unqualified table reference to "DUAL" as a built-in view returning one row and one column named "DUMMY", whose value is 'X'.

Unqualified table references to the DUAL table are resolved as SYSIBM.DUAL through the setting of the DB2_COMPATIBILITY_VECTOR registry variable.

If a user-defined table named DUAL exists, the DB2 server resolves a table reference to the user-defined table only if the reference is explicitly qualified.

Example 1

Generate a random number by selecting from DUAL.
   SELECT RAND() AS RANDOM_NUMBER FROM DUAL

Example 2

Retrieve the value of the CURRENT SCHEMA special register.
   SET SCHEMA = MYSCHEMA;
   SELECT CURRENT SCHEMA AS CURRENT_SCHEMA FROM DUAL;