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

SQL Anywhere 11.0.1 » SQL Anywhere Server - Database Administration » Maintaining Your Database » Automating tasks using schedules and events » Event handling tasks

 

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. In the left pane, right-click Events and choose New » Event.

  3. In the What Do You Want To Name The New Event field, type a name for the event and click Next.

  4. Select Manually and click Next.

  5. Select Enable This Event, Execute At All Databases, and then click Next.

  6. Type a comment describing the event and click Finish.

  7. In the SQL pane, type the SQL statements for your event.

  8. From the File menu, choose Save.

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

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