我有一个包裹,我需要在其中的桌子上放一把锁。
我在 main proc 的开头使用以下语句。
PROCEDURE proc_main IS
BEGIN
-- added by praphul to test locking
EXECUTE IMMEDIATE 'LOCK TABLE schema.XYZ IN EXCLUSIVE MODE NOWAIT';
收到以下错误:
SQL> exec ssss.abcd.proc_main();
BEGIN ssss.abcd.proc_main(); END;
*
ERROR at line 1:
ORA-20001: ERROR OCCURED AT STEP:500
REASON: abcd FAILED
SQLCODE: -1031
SYS-MSG: ORA-01031: insufficient privileges
ORA-06512: at "ssss.PROC_ERROR_RAISE", line 31
ORA-06512: at "ssss.abcd", line 156
ORA-06512: at line 1