AMT Help Files

Triggers

DML (data manipulation language) triggers on tables can be created in the AMT Developer Studio from the 'Triggers' node available in Database Table objects.

Please note, triggers are not supported on OS2200 DMS database tables. 

 

Creating a trigger


To create a new trigger, do the following:

 

Adjusting a trigger

Option:

Description:

Value:

Name

Name of the trigger.

<Text>

Description

Description of the trigger.

<Text>

DML action

Select the DML action(s) that executes the trigger. Multiple actions can be selected if supported by the database type used in your runtime environment.   

<Insert|Update|Delete>

Execute after DML

If checked, the trigger will execute after the DML action has been performed. If not checked, the trigger will execute before the DML action.

 

DB2

- Execute per row

- Execute per statement

For DB2 databases only: 

The trigger will can be executed once for each row in a transaction, or executed once for each transaction/statement.

Please note that this option is dependent on which type of database is used in your runtime environment:

  • MsSql: will always execute per statement.
  • Oracle: will always execute per row.
  • DB2: can use either option.

 

 

Deleting a trigger

Generate the application and reorganize the database

After a trigger is added, adjusted or deleted, a Whole System generate is required, followed by a database reorganize.

 

Triggers that were manually disabled, will be re-enabled by a database reorganize only when the columns in the triggers have been changed.
Unchanged triggers will not be re-enabled by a database reorganize.

 

 

In the code nodes, the SQL code of the trigger can be set.