Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 16 May 2012 @ 14:21:50 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Using ErrorCode and ActivityCount within Bteq
 
From:   David Clough

Is it possible to use the ErrorCode and ActivityCount within Bteq, other than with an IF statement ?

Rather than just something like :

     ".If ErrorCode <> 0 Then .Exit 12;"

I'd like to use the values to audit how many rows have been affected by a particular Sql Statement.

     ----------------------------------------------------
     INSERT INTO DEVCOADMIN_V.CORCOV01
      .....
     ,CON_SHIPPER_TYP_CD
     ,CON_ROW_UPDT_TD
      FROM CORCOW02 WRK2
     WHERE NOT EXISTS
      (SELECT 1 FROM DEVCOADMIN_V.CORCOV01 TGT1
       WHERE TGT1.CON_ID= WRK2.CON_ID
     ) ;

      *** Insert completed. No rows added.
      *** Total elapsed time was 1 second.

     INS INTO  DEVGTT_T.LOAD_LOG_GTT VALUES
     ('CORCOT01',ERRORCODE,ACTIVITYCOUNT,CURRENT_TIMESTAMP(0));
      *** Failure 5628 Column ERRORCODE not found in DEVGTT_T.LOAD_LOG_GTT.
                     Statement# 1, Info =0
     ----------------------------------------------------

It looks to me as though the ERRORCODE and ACTIVITYCOUNT can only be used for decision making but the actual number of rows affected (i.e. ACTIVITYCOUNT) cannot be used within the script.

Am I right ?


Regards

David Clough
Senior Database Designer
Database Design Group



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023