我已经加上了end了,可是提示一样
解决方案 »
- 刷卡消费 SQL建库建表
- 请问在数据库中NULL值是以什么形式存储的?
- 帮我看一下怎么会报如此错误
- 怎样在数据库后台拷贝文件?(成功300分送上)
- 求助:jpa查询sqlserver2005出现奇怪的问题
- 求教高手,简单问题:怎么查询出同名的人员名单?????
- SQL权限的问题,急啊。
- 初学者问题
- 如何编程ms sql server 2000 查询某个触发器的类型(即insert, delete or update)?
- 如何查找数据库中重复记录?
- 急死人了,我的OracleServer运行两天后又出问题了,请各位高手指点迷津。
- 我一不小心将system下的dba、connect角色删除,请问如何恢复?
我删除insert也没有用,
我这个trigger是在<<Oracle8i初学者指南>>机械工业出版,P67上抄下来的,能有怎么也有错
SQL> set serveroutput on
SQL> insert into customer
2 values
3 (11,'CHADIRDJIAN','JACK','QC',15003.32,39540.75);
insert into customer
*
ERROR 位于第 1 行:
ORA-04098: 触发器 'A.DISPLAY_NEW_SALES' 无效且未通过重新确认
insert into customer values(11,'CHADIRDJIAN','JACK','QC',15003.32,39540.75)
;
New sales amount: 39540.751 row created
你的问题有如下的提示,自己试试看吧:
Cause: A trigger was attempted to be retrieved for execution and was found to be invalid. This also means that compilation/authorization failed for the trigger. Action: The options are to resolve the compilation/authorization errors, disable the trigger, or drop the trigger. For more information about enabling and disabling triggers, see the index entries on "enabling, triggers," "disabling, triggers," and "DROP TRIGGER command" in Oracle7 Server SQL Reference
这种话毫无意义,可能是这个错误。
我这边试验也没有问题
2 before insert or update
3 on customer
4 for each row
5 declare
6 new_sales_amt number;
7 begin
8 new_sales_amt := :new.total_sales-nvl(:old.total_sales,0);
9 dbms_output.put_line('New sales amount: '|| new_sales_amt);
10 end;
11 /警告: 创建的触发器带有编译错误。SQL> sho errors
TRIGGER DISPLAY_NEW_SALES1 出现错误:
LINE/COL ERROR
-------- -------------------------------------------
4/19 PLS-00049: 错误的赋值变量 'NEW.TOTAL_SALES'
4/40 PLS-00049: 错误的赋值变量 'OLD.TOTAL_SALES'
你往后看pl_sql的时候就明白了,show error命令很管用