IBM Books

SQL Reference

CURRENT SCHEMA

The CURRENT SCHEMA special register specifies a VARCHAR(128) value that identifies the schema name used to qualify unqualified database object references where applicable in dynamically prepared SQL statements. 21

The initial value of CURRENT SCHEMA is the authorization ID of the current session user.

Its value can be changed by the SET SCHEMA statement (see SET SCHEMA).

The QUALIFIER bind option controls the schema name used to qualify unqualified database object references where applicable for static SQL statements (see Command Reference for more information).

Example

Set the schema for object qualification to 'D123'.

   SET CURRENT SCHEMA =  'D123'

Footnotes:

21
For compatibility with DB2 for OS/390, the special register CURRENT SQLID is treated as a synonym for CURRENT SCHEMA.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]