Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 16 Jul 2009 @ 10:29:32 GMT


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


Subj:   Re: Locking row for access
 
From:   Singh, Lakhwant

Hi Gautam,

As you know "Locking row for access" is applicable for SELECT only. So, it's good to use this locking modifier if you are SELECTing data from a table or a view as it will obtain locks on row level instead of table level.

In your case, the data flow is as follows:

Table A --> View V1 --> View V2 --> Table X


If you specify "LOCKING ROW for ACCESS" on Table A in the CREATE statement of View V1 as:

     CREATE VIEW V1 AS
     LOCKING ROW FOR ACCESS
     SELECT * FROM TABLE A

then even if you DO NOT specify "LOCKING ROW for ACCESS" in the following scenarios, the lock on Table A will be ACCESS only:

     SELECT * from V1        --> only ACCESS lock on Table A

     SELECT * from V2        --> only ACCESS lock on Table A

     INSERT into Table X     --> only ACCESS lock on Table A
     SELECT * from V2

Lakhwant



     
  <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