CURRENT RULES special register
CURRENT RULES specifies whether SQL statements are executed in accordance with Db2 rules or the rules of the SQL standard.
The data type of the register is CHAR(3), and the only valid values are 'DB2' and 'STD'.
CURRENT RULES is a register at the database server. If the server is not the local Db2, the initial value of the register is 'DB2'. Otherwise, the initial value is the same as the value of the SQLRULES bind option. The initial value of CURRENT RULES in a user-defined function or stored procedure is inherited according to the rules in Special registers in a user-defined function or a stored procedure.
You can change the value of the register by executing the statement SET CURRENT RULES.
CURRENT RULES affects the statements listed in the following table, which summarizes when the statements are affected and shows where to find more information.
Statement | What is affected |
---|---|
All statements |
The type of SQL error code Db2 issues for any SQL statements that reference object names that do not exist.
|
ALTER TABLE | The following behaviors:
|
CREATE TABLE | The following behaviors:
|
GRANT | Granting privileges to yourself. |
REVOKE | Revoking privileges from authorization IDs. |
SET CURRENT RULES = 'STD';