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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Automating Tasks Using Schedules and Events » Event handling tasks

Adding an event to a database Next Page

Adding a manually-triggered event to a database


If you create an event handler without a schedule or system event to trigger it, it is executed only when manually triggered.

To add a manually-triggered event to a database (Sybase Central)
  1. Connect to the database as a user with DBA authority.

  2. Select the Events folder for your database.

  3. From the File menu, choose New > Event.

    The Create Event wizard appears.

  4. Type a name for the event, and then click Next.

  5. Select Manually, and then click Next.

  6. Select Enable This Event, and select Execute at All Databases, and then click Next.

  7. Optionally, type a comment describing the event, and then click Finish to add the event to the database.

  8. Enter the SQL statements for your event handler, and then choose File > Save.

If you want to accept the default values for all remaining options, you can click Finish at an earlier stage in the wizard.

To add a manually-triggered event to a database (SQL)
  1. Connect to the database as a user with DBA authority.

  2. Execute a CREATE EVENT statement with no schedule or WHERE clause. The restricted syntax of the CREATE EVENT is as follows:

    CREATE EVENT event-name
    HANDLER
    BEGIN
    ... //event handler
    END

  3. If you are developing event handlers, you can add schedules or system events to control the triggering of an event later, either using Sybase Central or the ALTER EVENT statement.

    See also