Creating a SQL Anywhere or Sybase IQ Event

Use Database Development to specify a system event and define a corresponding event handler.

Prerequisites 

Before you can create an event, be sure the appropriate data server is running, and you created and established a connection to the data server.

  1. In Enterprise Explorer, under the database connection profile, expand the tree for a database.
  2. Right-click the Events folder, and select New > Event.
  3. Enter the event handler Name.
  4. (Optional) Select Disable Event to stop the event handler from executing when the scheduled time or triggering condition occurs.

    A trigger statement does not execute a disabled handler.

  5. Select the Execution Location.
    • All – the default value. All databases execute the event.

    • Consolidated – restricts the databases at which an event is handled.

    • Remote – restricts to remote sites the databases at which an event is handled.

  6. (Optional) Enter a description in the Comments field.
  7. Select a Trigger Type.
    Trigger type Description
    Manual If you create an event handler without a schedule or system event to trigger it, the handler is executed only when triggered manually.
    Schedule
    1. Click Next.

    2. Click Add.

    3. Enter the schedule Name.

    4. Under the General tab, set the start time you want the event to trigger. Use the At option to specify an exact time, or select the Between option to enter a time range.

    5. Select Start Date, then click Change Date to display an Event Calendar dialog from which you can select a month and day, which must be greater than or equal to today's date. Click OK to return to the Schedule page.

    6. Under the Repeat tab, indicate how often the event should repeat. Select Repeat Every to set the repeat frequency. Select Execute Event On to choose the Day(s) of the Week option or the Days of the Month option. Select the days of the week or month you want the event to repeat.

    7. Click OK to complete the schedule. You can schedule more events by selecting Add in the Provide the Schedule Information page and repeating the above process.

    Condition
    1. Click Next.

    2. Select one of the predefined system events from the list above the table.

    3. Specify the Conditions and their corresponding operators, values, and units.

  8. Click Next and specify save and execution properties.
    Field Description
    Generate Script Generate a SQL file for the object.
    Enter or Select the Parent Folder Specify an existing project or create a new project in which to save the SQL file.
    File Name Enter the file name in which to store the SQL code.
    Execute Immediately Execute the SQL code immediately. If you do not select this option, you must complete execution of the SQL file later to create the object.
    Open in Editor After Creation Create the object and open it in its associated editor.
  9. Click Finish to create the event handler.
Related concepts
Events
Related tasks
Editing an Event
Dropping an Event
Renaming an Event

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com