Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

I'm trying to automate a process in Teradata, if the count is greater than 5 then do not execute the below statement - response (1) by dnoeth

$
0
0

Which tool do you use to submit it?
In BTEQ and (SQL Assistant 13.10+) you can use basic conditional logic:

select count (*) from tableX
having count(*) > 5;
-- no row returned when count(*) <= 5

-- no need to any additional steps
.if activitycount = 1 then .exit;

or

-- just skip some statements and then go on
.if activitycount = 1 then .goto nextStep;
 
create volatile table T1 as
(
select * from TableA;
) with data
on commit preserve rows;
create volatile table t2 as
(
select * from TableB;
) with data
on commit preserve rows;

.label nextStep;

 
Dieter


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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