Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 16 Mar 2006 @ 18:28:19 GMT


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


Subj:   Capturing Activity Count insite bteqs
 
From:   Samarsingh_Chauhan

Hi All,

We have a bteq, which performs insertion.

Number of rows inserted is supposed to be inserted into a log table

How to capture the activity count of the first insert statement in the same bteq?

     // Some other operation..//

     INSERT INTO Table1
     SELECT Col1,COL2 FROM Table2
     WHERE ;

     .IF ERRORCODE <> 0 THEN .GOTO LogError;
     .IF ERRORCODE = 0 THEN .GOTO LogSuccess;

     .LABEL LogSuccess

     INSERT INTO LogTable
     (Col1,Col2, NoofRowsInstered, Status, Col4 . . )
     VALUES
     ('vaL1', 'Val2',???, 'SUCCESS'. . . );

     GOTO Proc;

     .LABEL LogError

     INSERT INTO LogTable
     (Col1, Col2, NoofRowsDeleted, Status, Col4 . .  )
     VALUES
     ('vaL1', 'Val2', 0, 'ERROR' . . .);

     GOTO Proc;

     .LABEL Proc;

     //Some processing.

     .QUIT

Please suggest how to capture the no of rows inserted by the first insert statement, without coming outa bteq.

In MLOAD we have &SYSINSCNT for this, but this sys variable is invalid in BTEQs.


Regards,

Samar



     
  <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: 27 Dec 2016