问题描述:

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.

相关阅读:
Top