locks

Database
Enthusiast

locks

Hi all,

How we can upgrade and downgrade the locks in Teradata

can any body explain on it...

Thanks in Advance....
1 REPLY
Enthusiast

Re: locks

To upgrade or downgrade a lock in Teradata, put a "LOCKING dbname.tablename FOR locklevel", where the "locklevel" is either ACCESS, READ, WRITE, or EXCLUSIVE in front of your SQL statement. You can also do a "LOCKING ROW FOR locklevel", if you want to have the DBMS lock at the row level. Example:

LOCKING ROW FOR ACCESS
SELECT *
FROM ...;

Teradata will override this if it needs to get a greater lock. So, if you're attempting to lock the table at the row level, and Teradata determines that it needs a table-level lock it will override what you specify. Likewise, if you specify a READ level lock and it needs a WRITE level lock, it will override you there as well.