Oracle 存储过程 删除表记录时删除不存在的记录也是显示删除成功 create or replace procedure delDept(p_deptno in dept.deptno%type) is begin delete from dept where deptno=p_deptno; dbms_output.put_line('部门删除成功...'); exception when others then dbms_output.put_line('部门删除失败...'); en…
sql%rowcount用于记录修改的条数,就如你在sqlplus下执行delete from之后提示已删除xx行一样,这个参数必须要在一个修改语句和commit之间放置,否则你就得不到正确的修改行数. 例如: declare n number; begin insert into test_a select level lv from dual connect by level<500; n:=sql%rowcount; commit; dbms_output.put_line(n); end…
sql server中,返回影响行数是:If @@RowCount<1 Oracle中,返回影响行数是:If sql%rowcount<1 例: sqlserver: create procedure Proc_test , )='', AS BEGIN Update T_Mt Set Stat=@Stat,OStat=@Stat,RptTime=Getdate() Where MsgId=@MsgId --没有更新成功就插入到t_Statbuf insert into t_statbuf(M…
oracle中.返回影响行数是:If sql%rowcount 举例: update ut_calenderStatus t set t.calenderstatus=pi_flg, t.m=pi_M, t.n=pi_N, t.prolong=pi_prolong where t.fundcode=pi_fundcode; if sql%rowcount=0 then insert into ut_calenderStatus values (pi_fundcode,pi_flg,pi_M,pi…