Create a Scripted User-Defined Procedure

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

Go Up to Creating and Editing SQL Procedures

Notepad blue icon 2.pngNote: The SQL in the procedure will be validated in context of the table selected.

  1. In the Data Model Window or Data Model Explorer, double-click a table to launch the Table Editor.
  2. Click the PreSQL & PostSQL tab.
  3. Enter or edit an SQL procedure to run before the CREATE TABLE statement.
  4. Click the PostSQL tab and then enter or edit an SQL procedures to run before the CREATE TABLE statement.
  5. Click OK to implement the changes and exit the editor.

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

See Also