Create a Templated User-Defined Procedure

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Creating and Editing SQL Procedures

The Templated Procedure Editor lets you create or edit a reusable procedure. Templated procedures are specific to the specific table on which they are created or modified. Reusable procedures created in the data dictionary can become templated if they are modified through the Table Editor. You can write templated procedures in BASIC.

Notes

  • In order for code to be generated for procedural logic such as triggers and procedures, the results of the logic must be stored in a variable called resultstring. For example, in the Northwind.dm1 sample model, the Data Dictionary lists a reusable trigger, SYSUPDATE, for the Oracle platform. The code for this trigger includes the following statement, which is required for code to be generated for the trigger:
    resultstring = trigBody
  • The Templated Procedure Editor includes find and replace functionality for working with SQL text strings.
  • Templated procedures are different from scripted procedures in that they are reusable.
  • You can only access the Templated Procedure Editor from the Dependencies tab of the Table Editor.
  • Procedures are considered to be data model schema, along with packages, functions, materialized views, auxiliary tables, synonyms, and triggers.

The schema objects tab of the options editor allows you to set default trigger actions for Parent and Child actions. It also enables you to apply default triggers to tables when relationships are created.


See Also