Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
40
Добавлен:
16.04.2013
Размер:
4.96 Mб
Скачать

Creating Triggers

Triggers can be:

DML triggers on tables.

INSTEAD OF triggers on views.

System triggers on DATABASE or SCHEMA: With DATABASE, triggers fire for each event for all users; with SCHEMA, triggers fire for each event for that specific user.

See Also: Oracle Database SQL Reference for information on trigger creation syntax

Overview of System Events

You can create triggers to be fired on any of the following:

DML statements (DELETE, INSERT, UPDATE)

DDL statements (CREATE, ALTER, DROP)

Database operations (SERVERERROR, LOGON, LOGOFF, STARTUP, SHUTDOWN)

Getting the Attributes of System Events

You can get certain event-specific attributes when the trigger is fired.

See Also: Chapter 10, "Working With System Events" for a complete list of the functions you can call to get the event attributes

Creating a trigger on DATABASE implies that the triggering event is outside the scope of a user (for example, database STARTUP and SHUTDOWN), and it applies to all users (for example, a trigger created on LOGON event by the DBA).

Creating a trigger on SCHEMA implies that the trigger is created in the current user's schema and is fired only for that user.

For each trigger, publication can be specified on DML and system events.

See Also: "Responding to System Events through Triggers" on page 9-50

Naming Triggers

Trigger names must be unique with respect to other triggers in the same schema. Trigger names do not need to be unique with respect to other schema objects, such

9-4 Oracle Database Application Developer's Guide - Fundamentals

Соседние файлы в папке Oracle 10g