Triggers and Stored Procedures

From InterBase
Jump to: navigation, search

Stored procedures and triggers are part of a database’s metadata and are written in stored procedure and trigger language, an InterBase extension to SQL. Procedure and trigger language includes SQL data manipulation statements and some powerful extensions, including IF … THEN … ELSE, WHILE … DO, FOR SELECT … DO, exceptions, and error handling.

  • A stored procedure is a program that can be called by applications or from IBConsole.

Stored procedures can be invoked directly from applications, or can be substituted for a table or view in a SELECT statement. They can receive input parameters from and return values to the calling application.

  • A trigger is a self-contained routine that is associated with a table. A trigger definition specifies an action to perform when a specified event, such as an update, insert, or delete occurs on the table. A trigger is never called directly by an application or user. Instead, when an application or user attempts to perform the action stated in the trigger definition, the trigger automatically executes, or fires.

See the Data Definition Guide for a full explanation of stored procedures and triggers.

Advance To:

Triggers