請找到下面的塊。如何處理異常並執行剩餘的語句?
for i in 1..acd.count loop
insert into customer_account_mapping select customerid,upper(pcd(i)),upper(acd(i)),cost from customer_master where customername=customer_name and concat(upper(pcd(i)),upper(acd(i))) not in (select concat(upper(pcode),upper(acode)) from customer_account_mapping);
insert into user_permissions select distinct user_id,sales_person_name,sales_mgr_name,upper(pcd(i)),upper(acd(i)) from user_permissions where sales_person_name=sales_person and concat(upper(pcd(i)),upper(acd(i))) not in (select concat(upper(pcode),upper(acode)) from user_permissions) and rownum<2 ;
commit;
end loop;
如果在第一個插入語句中發生錯誤,如何處理它並執行第二個插入語句。
這將是有益的格式化你的代碼,所以它不是一個長線的線。 –
每次插入後提交通常都是不好的做法。你爲什麼需要這樣做? – OldProgrammer