SQL Text with Arguments - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.6
Published
November 2018
Language
English (United States)
Last Update
2018-12-07
dita:mapPath
gxn1538171534877.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

SQL text containing substitution parameters may be specified in this function, with the substitution parameters specified as arguments to the function. The substitution parameters take the form of <Pn> in the SQL text, where n is a number from 1 to the number of parameters used. They correspond to the expressions passed as arguments into the text by dragging them into the Arguments folder under the function. The SQL generated for these argument expressions is what is substituted for the <P1> to <Pn> symbols in the SQL text.

This function therefore enables the use of constructs in an expression that may not otherwise be supported as SQL elements, while at the same time utilizing standard SQL elements as components of the SQL text. Of course in using this feature care should be taken to create a valid expression since validation is not performed on the SQL within the free-format text string.

When dragging a SQL Text operator into a variable, the following tree element is created.

Variable Creation > Input > Variables > SQL Elements Pane > Other > Arguments

Double-click on SQL Text with Arguments, or highlight it and click Properties and enter a valid SQL expression within the SQL Text area.

Variable Creation > Input > Variables > SQL Elements Pane > Other > Arguments > SQL Text Properties

The following is a Teradata-only example that generates a standard SQL Overlaps condition, i.e., (“acct_start_date”, “acct_end_date”) OVERLAPS (DATE '1995-10-01', DATE '1995-12-31').

SQL Text: (<P1>) OVERLAPS (<P2>)

Variable Creation > Input > Variables > SQL Elements Pane > Other > Arguments (example)