当前位置: 动力学知识库 > 问答 > 编程问答 >

plsql - error in pragma exception_init() Statement ignored in Oracle 10g

问题描述:

I am getting the error at line 7 (see the code below) which is specified by 10g as :

"Statement ignored"

Can anyone tell me what I'm doing wrong?

create or replace trigger demo1_bifer

BEFORE INSERT ON demo1

FOR EACH ROW

declare

lock_id number;

resource_busy exception;

pragma EXCEPTION_INIT(resource_busy,-54);

begin

lock_id := dbms_utility.get_hash_value(to_char(:new.x),0,1024);

if (dbms_lock.request( id => lock_id,lockmode => dbms_lock.x_mode, timeout => 0, release_on_commmit => TRUE) not in (0,4))

then raise resource_busy;

end if;

end;

/

网友答案:

You have mistyped commit in the parameter name release_on_commmit. Delete one of the three ms.

On my system (Oracle 11g XE) I also got an error PLS-00201: identifier 'DBMS_LOCK' must be declared. To fix this I needed to grant EXECUTE on DBMS_LOCK to the user I was creating the trigger as.

分享给朋友:
您可能感兴趣的文章:
随机阅读: