SENDING AN ALERT GIVEN THE MAIL THE VALUE OF CERTAIN VARIABLE

General
Enthusiast

SENDING AN ALERT GIVEN THE MAIL THE VALUE OF CERTAIN VARIABLE

Dear all, 

I would like to send an email to alert some users if a variable in my SQL bteq query is higer than a certain threshold. 

The simpliest idea I have got to manage the thresholds is to store them in a table and compare my variables to them.Is there a way I can send a mail at the end of the bteq script execution to alert about the variables that are higher than the thresholds? 

Thank you in advance, 

Cordially.