Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 29 Sep 2005 @ 21:10:58 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Error trapping a deadlock inside Bteq?
From:   mike_mayer

We are getting a classic read/write deadlock between two different processes hitting the same table.

However the deadlock does not cause Bteq's ERRORCODE to be set to something other than zero. That is, the query fails due to the deadlock but Bteq finishes without an error since the deadlock apparently is not flagged into ERRORCODE. Thus it remains 0 (success).

We have a line like this after each complete SELECT statement:


So unless ERRORCODE is greater than 0, the Bteq finishes OK. And since it appears to remain 0 after a deadlock query failure, the calling ksh script gets the 0 return code (and not the 22).

Haven't found anything so far in the docs to describe how to error-trap a deadlock via ERRORCODE from within the Bteq. Is there a way to have deadlocks included within the criteria of having ERRORCODE set > 0 when a deadlock happens? Maybe we're just not approaching it correctly.

In all, the solution is to move the scheduling around so the two processes don't collide, but we still need a solid deadlock error trap.

Thanks for any info.


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