Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 07 Aug 2013 @ 12:32:08 GMT


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


Subj:   Re: Locking 2 tables
 
From:   Dieter Noeth

Paul GRAHAM wrote:

  I'm creating a view which joins 2 tables. I know how to create the syntax for locking 1 table for access, but how do I write this for 2 tables?  


Just add another LOCKING:

     LOCKING TABLE a FOR ACCESS
     LOCKING TABLE b FOR ACCESS
     SELECT

Btw, i would prefer LOCK ROW ACCESS instead:

no need for adding all table names and it automatically upgrades to a table lock when neccessary.

In very old releases there used to be some problems with this approach (in some cases the row lock was upgraded to a table lock with READ instead of ACCESS), but now only some rare combinations in multi statemnet requests might show that behaviour (if at all).


Dieter



     
  <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