Create a Scripted User-Defined Procedure
Go Up to Creating and Editing SQL Procedures
- In the Data Model Window or Data Model Explorer, double-click a table to launch the Table Editor.
- Click the PreSQL & PostSQL tab.
- Enter or edit an SQL procedure to run before the CREATE TABLE statement.
- Click the PostSQL tab and then enter or edit an SQL procedures to run before the CREATE TABLE statement.
- 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