Create a Scripted User-Defined Procedure
Go Up to Creating and Editing SQL Procedures
Note: The SQL in the procedure is validated in context of the table selected.
To create a scripted user-defined procedure
- In the Data Model Explorer or Data Model window, double-click a table to launch the Table Editor.
- On the PreSQL & PostSQL tab, enter or edit an SQL procedure to run before the CREATE TABLE statement.
- On the PostSQL tab, enter or edit an SQL procedure to run after the CREATE TABLE statement.
- Click OK to implement the changes and exit the editor.
In order to generate code 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 to generate code for the trigger:
resultstring = trigBody