Archives of the TeradataForum 
 
 
Message Posted: Fri, 07 Jan 2011 @ 08:51:45 GMT 
 
  
 
 
 
 
  
|  Subj:  |   |  Re: BTEQ Restart Logic  |   
|     |   
|  From:  |   |  Jinesh P V  |   
  
 
 
  
Not a clean solution, but works. 
Create an empty file "bteq_restart_step.txt" before you start bteq. Change ".os" commands according to the OS. 
     .logon ${PTD_TDP}/${PTD_DB_USER},${PTD_DB_PASSWD};
     .run file bteq_restart_step.txt;
     .label sql1;
     DELETE FROM ${PQA_GSC_DCM_DB}.table1; ---- sq11
     .if errorcode <> 0 then .goto EXIT_ERROR; .if errorcode = 0 then .os echo '.goto sql2' >
     bteq_restart_step.txt;
     .label sql2;
     DELETE FROM ${PQA_GSC_DCM_DB}.table2; ---- sql2
     .if errorcode <> 0 then .goto EXIT_ERROR; .if errorcode = 0 then .os echo '.goto sql3' >
     bteq_restart_step.txt;
     .label sql3;
     DELETE FROM ${PQA_GSC_STG_DB}.table3; ---- sql3
     .if errorcode <> 0 then .goto EXIT_ERROR; .if errorcode = 0 then .os echo '.goto sql4' >
     bteq_restart_step.txt;
     .label sql4;
     DELETE FROM ${PQA_GSC_STG_DB}.table4; ---- sql4
     .if errorcode <> 0 then .goto EXIT_ERROR; .if errorcode = 0 then .os echo '.goto sql5' >
     bteq_restart_step.txt;
     .label sql5;
     DELETE FROM ${PQA_GSC_STG_DB}.table5; ---- sql5
     .os rm -f bteq_restart_step.txt;
     .quit 0;
     .label EXIT_ERROR;
     .quit 99;
 
 
 
 
   
 
 |