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.
Double-click on SQL Text with Arguments, or highlight it and click Properties and enter a valid SQL expression within the SQL Text area.
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>)