How to lock a Teradata table using PROC SQL Pass-through


Teradata table locking can be done using PROC SQL Pass-through (explicit pass-through). As PROC SQL Pass-through passes the DBMS specific SQL to the dbms server, the following example simply passes the Teradata specific syntax to lock the tables:

proc sql;
connect to teradata(user=* password=* server=*);
select * from connection to teradata
(LOCKING TABLE Employee FOR ACCESS
LOCKING TABLE Department FOR ACCESS
SELECT Name, Loc FROM Employee, Department WHERE
(EmpNo=MgrNo));
quit;