Start of change

SYSDUMMYx tables

DB2® for z/OS® provides a set of SYSDUMMYx catalog tables.

Begin general-use programming interface information.

The last character of the table name identifies the associated encoding scheme as follows:

  • SYSIBM.SYSDUMMY1 uses the EBCDIC encoding scheme.
  • SYSIBM.SYSDUMMYE uses the EBCDIC encoding scheme.
  • SYSIBM.SYSDUMMYA uses the ASCII encoding scheme.
  • SYSIBM.SYSDUMMYU uses the UNICODE encoding scheme.

Although the SYSDUMMYx tables are implemented as catalog tables, they are similar to sample tables, and are used in some examples in the DB2 for z/OS documentation.

You can use any of the SYSDUMMYx tables when you need to write a query, but no data from a table is referenced. In any query, you must specify a table reference in the FROM clause, but if the query does not reference any data from the table, it does not matter which table is referenced in the FROM clause. Each of the SYSDUMMYx tables contains one row, so a SYSDUMMYx table can be referenced in a SELECT INTO statement without the need for a predicate to limit the result to a single row of data.

For example, when you want to retrieve the value of a special register, you can use a query that references a SYSDUMMYx table.

SELECT CURRENT PATH -- Retrieve the value of a special register
 INTO :myvar
 FROM SYSIBM.SYSDUMMY1;

Sometimes when DB2 for z/OS processes an SQL statement, the statement is rewritten, and a reference to a SYSDUMMYx table is added. For example, some of the internal rewrites that result in adding a reference to a SYSDUMMYx table are for processing the search condition of a trigger, or the SQL PL control statements IF, REPEAT, RETURN, or WHILE. In these situations, the privilege set must include the SELECT privilege on the SYSDUMMYx table that is referenced.

End general-use programming interface information.
End of change