我是SQL新手。執行以下觸發器時出現錯誤。請幫助MYSQL - 觸發器
delimiter $$
create trigger cheque_update_trigger
after insert on cheque_details
for each row begin
declare banktype text; declare branchrefno int ;
select branch_ref_no into branchrefno from customer_account where acct_no = New.acct_no;
select type into banktype from branch_table where branch_ref_no = branchrefno;
if (type = 'ab') then
insert into ab_cheque_register values (New.cheque_no, branchrefno, New.fbank_ref_no, New.amount);
else if (type = 'nab') then
insert into nab_cheque_register values(New.cheque_no, branchrefno);
insert into osb_cheque_register values(New.cheque_no, branchrefno); else
insert into osb_cheque_register values(New.cheque_no, branchrefno);> end if;
end if;
end$$
delimiter;
... – Mureinik 2014-08-30 14:40:37
請更新問題與更多細節。其他方面,它會標記爲低質量 – 2014-08-30 14:46:33
**「我得到一個錯誤」**不是對問題的充分描述。 MySQL錯誤消息包含*詳細信息*,描述實際問題,而不僅僅是一些模糊的「出現錯誤」。你有問題*你想問嗎? – spencer7593 2014-08-30 15:16:48