Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » Database maintenance » Event tracing

 

Creating a user trace event

Create user trace events to track information within your application.

Prerequisites

You must have the MANAGE ANY TRACE SESSION and NOTIFY TRACE EVENT system privileges.

 Task
  1. Create the required user trace event for your database.

    For example:

    CREATE TEMPORARY TRACE EVENT my_event( id INTEGER, information LONG VARCHAR ); 

    You can create a stored procedure that runs when the database starts to create all required user trace events.

  2. Execute a NOTIFY TRACE EVENT statement for each user-defined event that is being traced for the database.

    For example:

    NOTIFY TRACE EVENT my_event( 1, 'Hello world' );

    The NOTIFY TRACE EVENT statement logs information about trace events to any trace session that is interested in the event. If an event is not defined when NOTIFY TRACE EVENT is executed, the database server generates an error. If an event does not exist, you can place the NOTIFY TRACE EVENT statement in a TRY block to define the behavior.

Results

The trace event exists until the database is shut down.

Next

Create a trace session for the database. See Creating a trace session.

 See also