Archives of the TeradataForum
Message Posted: Mon, 23 Aug 2004 @ 11:32:27 GMT
I have got the following sample sql in a single Bteq
Delete from final_table ; Insert into temp1 sel * from a; .if activitycount = 0 then .goto outer insert into temp2 sel * from b; .if activitycount = 0 then .goto outer insert into final_table sel * from temp1 union sel * from temp 2 ; .quit 0; .label outer Insert into statistics_trig Select 'final_table',count(*) from final_table ; .quit 0;
The statistics_trig has got 2 columns (tablename,count)....
The whole concept is if any of the Insert statement has 0 zeroes inserted i need to insert into the statistics_trig table the name of the final_table and its count which will be obviously 0 ..
Can anyone please let me know how to make this dynamic without mentinoing the Tablename as hardcoded one in the last
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|