bteq repeat

General

bteq repeat

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

3 REPLIES

Re: bteq repeat

got it. thanks
Enthusiast

Re: bteq repeat

Hi  Buddy,

can you please share the solution.. i am bit curious to know

how to handle this....

thanks!

Cheers!

Nishant

Teradata Employee

Re: bteq repeat

Yes, if you could share the solution please