Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is BTEQ really this limited in logic?

Status
Not open for further replies.

CapsuleCorpJX

IS-IT--Management
Jun 23, 2004
70
US
Basically I want to do this in a BTEQ script:

select cast(sum(value)/sum(value2) AS decimal(18,2)) from sometable;

.if <result> >= 0.8 then .quit 1

Would this work? From the reference pdf, it seems the only thing that if statements can check is Activity_count and error codes. That and I have no idea how to store the result of the query into a variable.

Also, BTEQ doesn't seem to have "else if" or "else".
 
You're right, activitycount, errorlevel and errocode are the only pre-defined variables:

select
cast(sum(value)/sum(value2) AS decimal(18,2)) as x
from sometable
having x >= 0.8;

.if activitycount > 0 then .quit 1;

Dieter

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top