The following example outlines how to use Run Units to run a program file (in this case, bteq) to generate SQL and table output:
- Create a simple python script that will return hello world! when it is executed on LINUX.
-
Save this script in a file called helloworld.py in the local directory C:\Temp\Script Operator.
#!/usr/bin/python print 'hello world!'
-
Drag an Execute Program/Script Run Unit onto the Run Units tab of the Variable Creation input screen.
“Hello World” Example: Run Units tab with Execute Program/Script Run Unit
-
Enter the Program File (bteq.exe) and script on the Properties dialog, and then click OK or Save and Run.
“Hello World” Example: Properties dialog with bteq.exe and script entered
-
Drag a SCRIPT Table Operator SQL element onto the Tables tab.
“Hello World” Example: Tables tab with SCRIPT Table Operator
-
After setting the Input Source to Function Table, select the text column onto the Variables tab.
“Hello World” Example: Variables tab with text column selected
-
Run the Variable Creation analysis, generating the following SQL.
“Hello World” Example: Generated SQL
The following table appears, with one column containing “hello world!” and one row for each Teradata node.
“Hello World” Example: Table Result