BTEQ error handling

Applications
Applications covers the world of Teradata apps, including apps offered by Teradata (such as TRM or DCM), as well as best practices and methodologies for building your own Teradata-connected apps.
Enthusiast

BTEQ error handling

Hi Team,

 

  I have a BTEQ that parform activity count check. if activity count is zero, the query has to come out with a message. following is my query.

I face an issue that the BTEQ comes out even if the activity count is not zero. 

 

Below is the query in BTEQ

 

BT;

Insert query;

Query to check count;

IF ACTIVITYCOUNT = 0
THEN
.REMARK 'THE COUNT DID NOT MATCH FOR ZEDV243_LOAN_CHARAC TABLE ';
.QUIT

ET;

BT;

next queries

ET;

 

3 REPLIES
Junior Contributor

Re: BTEQ error handling

 

Insert query;

Query to check count;

IF ACTIVITYCOUNT = 0


What's this Query to check count;?

Enthusiast

Re: BTEQ error handling

Hi dieter,

 

SELECT * FROM AUDT_TABLE
WHERE DATABASENAME = 'VAL1'
AND VIEWNAME = 'VAL2'
AND COLUMNNAME = 'VAL3'
AND BEFORE_CNT = AFTR_CNT ;

Teradata Employee

Re: BTEQ error handling

I assume the BTEQ output shows a row returned from the check query?

 

I suspect the problem is the way you are mixing single-line (dot prefixed) and multi-line (semicolon terminated) command syntax.

Try either of these consistent syntax forms:

 

-- Dot prefixed style must be a single line

.IF ACTIVITYCOUNT = 0 THEN .REMARK 'THE COUNT DID NOT MATCH FOR ZEDV243_LOAN_CHARAC TABLE '

 

-- More flexible semicolon terminated style

IF ACTIVITYCOUNT = 0
THEN
REMARK 'THE COUNT DID NOT MATCH FOR ZEDV243_LOAN_CHARAC TABLE ';