sys触发器

来源:百度知道 编辑:UC知道 时间:2024/09/28 11:01:23
create or replace trigger pro_dataupdate
before update on product
for each row
when(new.p_price>0)
declare
gra_diff number;
begin
gra_diff:=:new.p_price-:old.p_price;
dbms_output.put_line(:old.p_name||'的价格被修改!');
dbms_output.put_line('修改前的价格'||:old.p_price);
dbms_output.put_line(修改后的价格||:new.p_price);
dbms_output.put_line(价格增加了||gra_diff||'元');
end;
*
第 1 行出现错误:
ORA-04089: 无法对 SYS 拥有的对象创建触发器

我用sys登陆的怎么还是不行?如果要对system修改权限应该修改哪些权限呢?

表product是不是在system用户下建立的?

system用户一般用来管理数据库的,建议另外创建一个用户或者使用scott/tiger用户来进行学习操作

connect,dba,resource,unlimited tablespace