create table cardInfo
(cardId int primary key,
password char(6) not null,
money number); create table transInfo
(cardId int references cardInfo(cardId),
transtype char(4) check(transtype='支取' or transtype='存入'),
transMoney number,
transDate date);
---触发器
create or replace trigger delTrans
before
delete
on transInfo
for each row
begin
if floor(months_between(sysdate,:old.transDate)) < 1 then
raise_application_error(-20001,'dsa');
end if;
end; insert into cardInfo values(1,'dsad',23);
insert into transInfo values(1,'支取',34,sysdate);
--执行这句话时报错
delete from transInfo where cardid=1;ORA-20001: dsa
ORA-06512: 在 "ADMIN.DELTRANS", line 3
ORA-04088: 触发器 'ADMIN.DELTRANS' 执行过程中出错查看错误堆栈的程序源?
(cardId int primary key,
password char(6) not null,
money number); create table transInfo
(cardId int references cardInfo(cardId),
transtype char(4) check(transtype='支取' or transtype='存入'),
transMoney number,
transDate date);
---触发器
create or replace trigger delTrans
before
delete
on transInfo
for each row
begin
if floor(months_between(sysdate,:old.transDate)) < 1 then
raise_application_error(-20001,'dsa');
end if;
end; insert into cardInfo values(1,'dsad',23);
insert into transInfo values(1,'支取',34,sysdate);
--执行这句话时报错
delete from transInfo where cardid=1;ORA-20001: dsa
ORA-06512: 在 "ADMIN.DELTRANS", line 3
ORA-04088: 触发器 'ADMIN.DELTRANS' 执行过程中出错查看错误堆栈的程序源?
说明floor(months_between(sysdate,:old.transDate)) < 1符合条件
如果把1改为0,可能就不报错了
运行程序,选择菜单“帮助 > 输入许可数据”启动“许可向导”。
将以下数据复制并粘贴到“许可向导”的相应字段中即可。
名字:Windows
公司:IC
序列号:03-50-008187
许可密钥:ACDDHB JQ2D9S 7ZAA5G CVNX41 ADAQB9 6ZVPYK PQ4EF1 84V5JM
发布日期:26-07-2006