Creating Triggers and Stored Procedures

From InterBase

Go Up to Procedures and Triggers


Stored procedures and triggers are defined with the CREATE PROCEDURE and CREATE TRIGGER statements, respectively. Each of these statements is composed of a header and a body.

The header contains::

  • The name of the procedure or trigger, unique within the database.
  • For a trigger:
  • A table name, identifying the table that causes the trigger to fire.
  • Statements that determine when the trigger fires.
  • For a stored procedure:
  • An optional list of input parameters and their data types.
  • If the procedure returns values to the calling program, a list of output parameters and their data types.

The body contains: :

  • An optional list of local variables and their data types.
  • A block of statements in InterBase procedure and trigger language, bracketed by BEGIN and END. A block can itself include other blocks, so that there may be many levels of nesting.

Advance To: