Events (IQ/SQL Anywhere)

Sybase IQ (v12.7 and higher) and SQL Anywhere (v10 and higher) support events, which allow you to automate and schedule actions. PowerDesigner models events as extended objects with a stereotype of <<Event>>.

Creating an event

You can create an event in any of the following ways:

  • Select Model > Events to access the List of Events, and click the Add a Row tool.

  • Right-click the model (or a package) in the Browser, and select New > Event.

Event Properties

You can modify an object's properties from its property sheet. To open an event property sheet, double-click its diagram symbol or its Browser entry in the Events folder.

The following extended attributes are available on the Sybase tab:

Name

Description

Event is scheduled

Specifies that the server carries out a set of actions according to a schedule of times.

If selected, this option disables the "Event is triggered" option.

Scripting name: ScheduledEvent

Schedule definition

Enter the schedule of event trigger times here. Click the New button to launch a dedicated editor window.

Scripting name: SchedulesText

Event is triggered

Specifies that the server carries out a set of actions when a predefined type of system event occurs.

This option is the default and, if selected, disables the "Event is scheduled" option.

Scripting name: TypedEvent

Event type

The event-type is one of the listed set of system-defined event types. The event types are case insensitive. To specify the conditions under which this event-type triggers the event, use the WHERE clause.

Scripting name: EventType

Trigger condition

Determines the condition under which an event is fired. For example, to take an action when the disk containing the transaction log becomes more than 80% full, use the following triggering condition:

WHERE event_condition( 'LogDiskSpacePercentFree' ) < 20

The argument to the event_condition function must be valid for the event type.

You can use multiple AND conditions to make up the WHERE clause, but you cannot use OR conditions or other conditions.

Scripting name: TriggerCondition

Handler

Each event has one handler.

The actions of an event handler are committed if no error is detected during execution, and rolled back if errors are detected.

Scripting name: Handler

Enable

By default, event handlers are enabled. When DISABLE is specified, the event handler does not execute even when the scheduled time or triggering condition occurs. A TRIGGER EVENT statement does not cause a disabled event handler to be executed.

Scripting name: Enable

At (databases)

If you want to execute events at remote or consolidated databases in a SQL Remote setup, you can use this clause to restrict the databases at which the event is handled. By default, all databases execute the event.

Scripting name: Database