You can review DBQL rules one of two ways:
- Use the SHOW QUERY LOGGING statement to determine which rule to use for a specified user/account/application. For example:
SHOW QUERY LOGGING ON marketinguser;
- Use the DBC.DBQLRules[V] view as a window into the contents of the DBC.RuleTbl which stores all DBQL rules in the system.
The following table describes the rules the system checks, depending on the SHOW QUERY LOGGING statement you submit. If you only list a user name or an account string, the SHOW QUERY LOGGING statement shows the Best Fit Rule.
Only a user with EXECUTE privilege on DBC.DBQLAccessMacro can run the SHOW QUERY LOGGING statement.
| SHOW QUERY LOGGING Option | Result |
|---|---|
| ALL | System shows the first rule in the hierarchy that applies, looking only at all/all accounts |
| User1 acct1 | System shows the first rule in the hierarchy that applies, looking at:
|
| User2 | System shows the first rule in the hierarchy that applies, looking only at:
|
| ALL acct3 | System shows the rule hierarchy (in hierarchy order) that applies for any user that logged on under acct 3. The system looks only at:
|
| APPLNAME='xxx' | System shows APPLNAME='xxx', which is the only APPLNAME rule that applies. |
The DBC.DBQLRules[V] view provides a window into the contents of the DBQLRuleTbl table and shows which rules the system applies. Only a user with SELECT privilege on DBC.DBQLRules[V] can access the view. For more information, see DBQLRulesV.
A SELECT on the DBQLRules[V] view displays the rules in effect. You can qualify the response by user name, or account string (if any), or both. For example:
SELECT * FROM DBC.DBQLRULESV WHERE ACCOUNTSTRING='$L00Test&D&H';