【发布时间】:2022-01-14 23:19:24
【问题描述】:
所以我做了一个这样的触发器插入:
create or replace trigger discount
after insert on transaction
for each row
begin
if (new.desc_date = 'Y') then
insert into desc_transaction(discount) values (new.discount = '0.1');
end if;
end;
/
警告:触发器创建时出现编译错误。
show error;
3/1 PL/SQL: SQL Statement ignored
3/54 PL/SQL: ORA-00917: missing comma
如何解决。
数据: desc_date 仅包含 yes 和 no 因为如果 11 月打折而 10 月没有打折。 对于折扣部分包含 0.1 和 null,因此如果 desc_date 为 yes,则为 0.1,否则将为 null 或 ' '。
【问题讨论】: