Use this statement to create a new trigger in the database in a manner compatible with Adaptive Server Enterprise.
CREATE TRIGGER [owner.]trigger_name ON [owner.]table_name FOR { INSERT, UPDATE, DELETE } AS statement-list
CREATE TRIGGER [owner.]trigger_name ON [owner.]table_name FOR {INSERT, UPDATE} AS [ IF UPDATE ( column_name ) [ { AND | OR } UPDATE ( column_name ) ] ... ] statement-list [ IF UPDATE ( column_name ) [ { AND | OR} UPDATE ( column_name ) ] ... ] statement-list
The rows deleted or inserted are held in two temporary tables. In the Transact-SQL form of triggers, they can be accessed using the table names deleted, and inserted, as in Adaptive Server Enterprise. In the Watcom-SQL CREATE TRIGGER statement, these rows are accessed using the REFERENCING clause.
Trigger names must be unique in the database.
Transact-SQL triggers are executed AFTER the triggering statement.
Must have RESOURCE authority and have ALTER permissions on the table, or must have DBA authority.
CREATE TRIGGER locks all the rows on the table, and requires exclusive use of the table.
Automatic commit.
SQL/2003 Vendor extension.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |