Variables for Triggers and Procedures

PowerDesigner can use variables in the generation and reverse-engineering of triggers and procedures. Parent table variables are also available.

The following variables are available for triggers:

Variable

Comment

%ORDER%

Order number of Trigger (in case DBMS support more than one trigger of one type)

%TRIGGER%

Generated code of trigger

%TRGTYPE%

Trigger type. It contains Keywords "beforeinsert", "afterupdate", ...etc.

%TRGEVENT%

Trigger event. It contains Keywords "insert", "update", "delete"

%TRGTIME%

Trigger time. It contains Keywords NULL, "before", "after"

%REFNO%

Reference order number in List of references of Table

%ERRNO%

Error number for standard error

%ERRMSG%

Error message for standard error

%MSGTAB%

Name of Table containing user-defined error messages

%MSGNO%

Name of Column containing Error numbers in User-defined error table

%MSGTXT%

Name of Column containing Error messages in User-defined error table

%SCRIPT%

SQL script of trigger or procedure.

%TRGBODY%

Trigger body (only for Oracle live database reverse engineering)

%TRGDESC%

Trigger description (only for Oracle live database reverse engineering)

%TRGDEFN%

Trigger definition

%TRGSCOPE%

Trigger scope (keywords: database, schema, all server)

%TRGSCOPEOWNER%

Trigger scope owner

%TRGSCOPEQUALIFIER%

Trigger scope owner plus dot

The following variables are available for procedures:

Variable

Comment

%PROC%

Generated code of Procedure (also available for trigger when Trigger is implemented with a procedure)

%FUNC%

Generated code of Procedure if Procedure is a function (with a return value)

%PROCPRMS%

List of parameters of the procedure