尝试创建触发器以让用户一天只插入5次

时间:2018-11-19 16:33:56

标签: sql oracle oracle-apex

create or replace trigger trg_check_placement 
before insert 
on lds_placement
for each row
declare 
    plt_count number;
begin
select count(*) into plt_count  from lds_placement where TO_CHAR(sysdate,'HH24:MI:SS');
if plt_count >5 then
raise_application_error(-20000, 'Sorry! you cannot create more than five placement a day');
end if;
end;

继续在第4行获得错误无效的关系运算符,这是解决此问题的正确方法还是我完全错了?

0 个答案:

没有答案