Archives of the TeradataForum
Message Posted: Wed, 17 Apr 2002 @ 13:48:41 GMT
I use a primitive brute force method to do something similar to what you describe. Most of what I do uses the DBC tables as input to generate redundant SQL.
Assuming your prepopulated table (T1) has three columns (C1,C2,C3), suppose C1 contains the name of a table you want to read, C2 contains the name of a column and C3 contains a value within another column you want to check and you only need one row from the table to provide your variables then you can write something like:
The code outside the parenthesis reads every row in your prepopulated table replacing C1,C2 and C3 with the values in those columns. The result set is a row of SQL for every row in your prepopulated sql. I usuallly copy/paste the rows into queryman and run the code but you can also write it to another file that is then called by bteq.
The sets of four quotes is needed to surround the contents of your columns with quotes. If your column is numeric then they are not needed. The double vertical lines concatenate each row into a single column (which is later named XQL)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|