- Call Stored Procedure
- Execute Macro
- Execute Program/Script
- SQL Text with Arguments
- Click on INPUT on the Variable Creation dialog.
- Click on variables on the upper tabs.
- Click on Run Units on the large tab in the center.
Run Units have a category of their own in the SQL Elements tree, from which each of the Run Units elements may be dragged or selected onto the Run Units tab. When a Variable Creation analysis is executed, any Run Units defined on the Run Units tab are first executed in the order of appearance (unless they are marked “Skip”), and then if variables are defined on the Variables tab, a query or sub-query is built or defined in the usual manner.
When the Properties button is selected and a Run Unit is highlighted, the following dialog appears.
Run Unit Name — A name must be specified for each Run Unit. The name is initially assigned automatically, beginning with Run Unit1 and incrementing the trailing number.Run Units can be re-named by single left-clicking on the name, which produces a box around the name (as in Windows Explorer).
- Description — An optional description may be specified for each Run Unit.
- Skip Execution — When this is checked, the Run Unit is not executed as part of the analysis.
- Skip Adding to Results SQL — When this is checked, the SQL generated by this Run Unit is not included in Results. This may be necessary when creating a stored procedure using the options on the Output panel or when publishing a chain of analyses, for example.
When the New button is selected while the Run Units tab is selected, the following tree element is created.
- Call Stored Procedure — In the SQL Elements category Run Units, select Call Stored Procedures (any) and drop or move it on top of the “(empty)” node. A Properties dialog appears so that a specific stored procedure can be selected and argument descriptions viewed. Alternately, a specific stored procedure may be selected from the sub-categories underneath Run Units, such as Geospatial Procedures, JSON Procedures, or XML Procedures. A check box option to automatically generate arguments is available on the Properties dialog. For details, refer to Call Stored Procedure (any) (Teradata Database).
- Execute Macro — In the SQL Elements category Run Units, select Execute Macro (any) and drop or move it on top of the “(empty)” node. A Properties dialog appears so that a specific macro can be selected and argument descriptions viewed. A check box option to automatically generate arguments is available on the Properties dialog. For details, refer to Execute Macro (any) (Teradata Database).
- Execute Program/Script — In the SQL Elements category Run Units, select Execute Program/Script and drop or move it on top of the “(empty)” node. A Properties dialog appears so that a specific program and script can be selected and executed. For details, refer to Execute Program/Script (any).
- SQL Text with Arguments — In the SQL Elements category Run Units, select SQL Text with Arguments and drop or move it on top of the “(empty)” node underneath a Run Unit. A Properties dialog appears so that one or more SQL statements may be entered, along with optional placeholders for substitution arguments. If entered, these are matched with SQL elements or expressions placed in the Arguments folder underneath the element. The SQL generated for these argument expressions is what is substituted for the <P1> to <Pn> symbols in the SQL text, where n is the number of arguments. Note that this is the same SQL element that is available in the Other or SQL Elements category. For details, refer to SQL Text with Arguments.
Run Unit Options are also available from a pop-up menu that is displayed after right-clicking on a Run Unit, as pictured below.
- Execute this Run Unit — A Run Unit may be executed by itself by using this option. Note that this option executes the analysis but inhibits other processing so that only this Run Unit is executed. It may not be used when the analysis or any of its Run Units is executing.
- Generate Arguments — This option is available only when the Run Unit is of Call Stored Procedure or Execute Macro type and the Arguments folder under the Run Unit is empty. For stored procedures, Input arguments consist of Literal elements of the appropriate type (string, number, date etc.), while Input-Output and Output arguments consist of Literal Parameter elements of the appropriate type so that they may receive the final value of the argument after execution. Generated macro arguments always consist of Literal elements of the appropriate type. For more information about the use of Literal Parameter SQL elements in Call Stored Procedure Run Units, refer to the description of the Call Stored Procedure SQL element.
- Skip On/Off — This option toggles the selected Run Unit’s Skip status on or off. If on, the Run Unit name is preceded by “[Skip]”.
- Skip All — This option marks all Run Units as [Skip].
- Skip None — This option removes any [Skip] status present on all Run Units.