Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 28 Jan 2011 @ 12:43:46 GMT


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


Subj:   Failed Transactions to Rollback
 
From:   Naveedahmed M

Hi ALL,

Please help me for the below scenario.

I have many sqls under one BTEQ script and when any of the sql fails in between, all the transactions to be rollback completely.

I am using BTET (DEFAULT) mode. i need more info on this.

Example Code:

     .logon ${PTD_TDP}/${PTD_DB_USER},${PTD_DB_PASSWD};

     DELETE FROM Table1;

     .if errorcode <> 0 then .goto EXIT_ERROR


      DELETE FROM Table2;

     .if errorcode <> 0 then .goto EXIT_ERROR


      DELETE FROM Table3;

      .if errorcode <> 0 then .goto EXIT_ERROR


     DELETE FROM Table4;

     .if errorcode <> 0 then .goto EXIT_ERROR

     .quit 0
     .label EXIT_ERROR
     .remark '*** Error detected in BTEQ scipt ***'
     .quit 99

Thanks

Naveed



     
  <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