Routine Objects

Routine objects are the building blocks of a database application. Database Development builds the skeleton for routine objects and provides tools to populate the body of the object with the appropriate SQL.

Routine objects standardize actions performed by more than one application program. By coding an action once and storing it in the database for future use, applications need only execute the routine or fire the trigger to achieve the desired result repeatedly. Because changes occur in only one place, all applications using the action automatically acquire the new functionality if the implementation of the action changes. When you create an object, it is automatically checked for correct syntax and stored in the system tables. The first time any application calls or fires the object, it is compiled from the system tables into the server's virtual memory and executed from there.

Table 1. Object types
Object type Description
Stored procedures A stored procedure is a collection of SQL statements and optional control-of-flow statements. A stored procedure can use parameters to accept values and return values to the calling environment. A stored procedure can also return result sets or invoke other procedures.
Triggers A trigger is a special form of stored procedure that executes when a user attempts to change table or column data using a command such as insert, delete, or update. Triggers can call stored procedures and functions and can fire other triggers. Triggers are often used to enforce referential integrity and can cascade changes through related tables, roll back transactions, enforce complex restrictions, and perform simple analyses.

You can develop the object types that your database and server support.

Related tasks
Running a Routine Object
Creating a Launch Configuration for Routine Objects
Viewing SQL Results