AuditSQL (Method)

Applies To:

Query object, DataModel object

Description:

Enables you to define SQL Statements that execute when audit events are triggered. This record show Interactive Reporting Studio, a database server, or network resources are used. When triggered, SQL statements update an audit log table, which administrators can query to monitor data.

Syntax:

Expression.AuditSQL(EventType As BqAuditEventType, SQLStatement As String) 

Expression Required:

An expression that returns a Query Object

Constants:

The BqAuditEventType constant group consists of these values:

Example 1:

In this example, an audit event is triggered when the user logs on:

ActiveDocument.Sections["Query"].DataModel.AuditSQl(bqAuditLogon,"Select username from all_users")

Example 2:

In this example, an audit event is triggered when the user logs off:

ActiveDocument.Sections["Query"].DataModel.AuditSQl(bqAuditLogoff,"Select username from all_users")

Example 3:

In this example, an audit event is triggered when Process is selected, but before the SQL query statement executes:

ActiveDocument.Sections["Query"].DataModel.AuditSQl(bqAuditPreProcess,"Select username from all_users")

Example 4:

In this example, an audit event is triggered when the final row in the Results set retrieves to the client workstation:

ActiveDocument.Sections["Query"].DataModel.AuditSQl(bqAuditPostProcess,"Select username from all_users")