Working with Triggers Using a Data Definition File
Go Up to About Triggers
To create or alter a trigger through a data definition file, follow these steps:
- 1. Use a text editor to write the data definition file.
- 2. Save the file.
- 3. Process the file with
isql
. Use the command:
isql -input filename database_name
- where <filename> is the name of the data definition file and <database_name> is the name of the database used. Alternatively, from within
isql
, you can interactively process the file using the command:
SQL> input filename;
- Note: If you do not specify the database on the command line or interactively, the data definition file must include a statement to create or open a database.
The data definition file may include:
- Statements to create, alter, or drop triggers. The file can also include statements to create, alter, or drop procedures and exceptions. Exceptions must be created and committed before they can be referenced in procedures and triggers.
- Any other
isql
statements.