Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

bteq repeat - forum topic by LeafNode

$
0
0

I need to run an insert query in a BTEQ based on the number of records in another table. 
SELECT BU_ID FROM TABLE1 WHERE BU_FLAG = 'A';
for example, if the output is 5 values then my insert query in a BTEQ (loads other tables) should run for 5 times for each business unit. I have to run these queries from a JCL, so don't want to handle this logic in the JCL otherwise there is no option.
We have only 10 rows in our table1. The users will manually set the flag every month end. I can try REPEAT but can we pass the number of records at the run time from another query?
- prax

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>