In SQL Server, the number of affected rows returned is: If @ @RowCount <1
In Oracle, the number of affected rows returned is: If sql%rowcount<1
Cases:
Sql server:
Create procedureproc_test@Stat int=0, @MsgId varchar( -)="', as BEGIN UpdateT_mtSetStat=@Stat, Ostat=@Stat, Rpttime=Getdate()WhereMsgId=@MsgId If @ @RowCount<1 --INSERT into T_STATBUF without update success Insert intoT_statbuf (Msgid,stat,rpttime)Values(@MsgId,@Stat,Getdate()) END
Oracle
CREATE OR REPLACE PROCEDURETest as BEGIN UpdateMy_time_test1SetDiscript= '6' whereDiscript= '1' ; IfSql%RowCount>1 Then --The above update affects the number of rows >1 is inserted into the My_time_test1 Insert intoMy_time_test1Values(Sysdate,'7'); End if; END;
Reference: http://www.linuxidc.com/Linux/2012-01/51693.htm
Oracle Sql%rowcount Returns the number of rows affected, SQL Server @ @RowCount returns the number of affected rows