Chapter 5 Building Triggers and Procedures


Trigger properties

Each trigger definition includes the following properties:

Property Description
Name The name of the item which should be clear and meaningful, and should convey the item's purpose to non-technical users
Code The technical name of the item used for generating code or scripts, which may be abbreviated, and should not generally include spaces
Comment Descriptive label for the trigger
Stereotype Sub-classification used to extend the semantics of an object without changing its structure; it can be predefined or user-defined
Owner Name of trigger owner. You choose an owner from a list of users. A trigger can only have one owner at a time. This is normally the trigger creator
Table Table attached to trigger
Generate Indicates to generate trigger
User-defined (Read-only) Indicates that the trigger definition is modified by user. You modify a trigger definition when you change the trigger template script in the Definition page of the trigger

A trigger definition also includes the following properties, each with their respective page:

Property Description
Definition Definition of trigger
Template Items Template items available for current DBMS
Preview Previews of trigger definition code

The Definition page of the trigger property sheet also includes the following trigger properties:

Property Description
Template Template on which the trigger is based
User-defined This button is automatically depressed when you modify the definition of a trigger, that is to say the trigger template code. You can click the User-Defined button to restore the trigger definition as it is provided in the template
Time Time attribute of the template. The content of the dropdown listbox depends on the DBMS
Event Event attribute of the template. The content of the dropdown listbox depends on the DBMS
Order Firing order of trigger

Time and event

You can customize the trigger time and event, and you can also handle multiple events on a single trigger.

The time and event dropdown listboxes are filled with the values defined in the trigger template and the values defined in the Time and Event entries in the Trigger category of the DBMS editor. For example, if you define Select as an event in the DBMS definition file, it will appear in the list of events.

For more information on the Definition tab tools, see "Using the Definition tab toolbar".

For more information on triggers with multiple event, see section Defining triggers with multiple events.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.