ORACLE之删除行,提交命令,回滚命令

twn_ryjffa 表名

 

delete from twn_ryjffa

   where getsure_unit_no = sgetsure_unit_no

     and insure_vol = sinsure_vol

     and insure_level = sinsure_level

     and insure_itype = sinsure_itype

     and wk_year = swk_year;

 

 commit;

 

commit :在手动写命令或过程中最后记得写commit否则结果不会永久生效

 

rollback:当出现异常时,完全取消事务的结果

 

例:

exception

 when others then

    sresult := 'select ''-1'' msgno,''由于其他原因删除经费方案失败' || sqlcode || ' ' ||

               sqlerrm || '!'' msg from dual';

    rollback;