Variable Creation - INPUT - Variables - Run Units - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.4
Published
July 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
fcf1492702067123.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software
The term Run Unit represents one of the following “execution” SQL elements:
  • Call Stored Procedure
  • Execute Macro
  • Execute Program/Script
  • SQL Text with Arguments
Perform the steps below to navigate to the Run Units tab.
  1. Click on INPUT on the Variable Creation dialog.
  2. Click on variables on the upper tabs.
  3. 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.

A recursive view definition (with no variables on the Variables tab) may also follow-up the execution of Run Units.

When the Properties button is selected and a Run Unit is highlighted, the following dialog appears.

Variable Creation > Input > Variables: SQL Elements Pane > Run Units > Run Unit Properties

  • 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.

Variable Creation > Input > Variables: SQL Elements Pane > Run Units > Run Unit Tree

The (empty) node under the Run Unit1 node should be replaced with one of the following:
  • 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.

Variable Creation > Input > Variables: SQL Elements Pane > Run Units > Run Unit Right-Click Options

The Run Unit Options are listed 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.