为什么这给我错误?警告:使用编译错误创建的过程?
CREATE OR REPLACE trigger customerLineCount
BEFORE insert on cust_line
for each row
when(new.cust_id > 0)
DECLARE
lineCount number;
BEGIN
select count (*) into lineCount
from (cust_line inner join customer
on cust_line.cust_id = customer.cust_id)
where (customer.cust_id = :new.cust_id)
if :new.gender = "m" and lineCount = 3 THEN
dbms_output.put_line ('Error! User already has 3 lines');
elseif :new.gender = "f" and lineCount = 1 THEN
dbms_output.put_line ('Error! User already has 1 line');
end if;
END customerLineCount;
/
请运行`show errors`来查看编译错误消息是什么(或者从user_errors等中选择它) – derobert 2011-12-14 18:50:18