SQL%ROWCOUNT好象不行嘛,我这样试一下:create or replace procedure ModifyCardID( OldCardID G_CARDS.CARD_ID%Type, NewCardID G_CARDS.CARD_ID%Type, Update1Row Out Number, Update2Row Out Number ) Is begin Update G_CARDS set CARD_ID=NewCardID where CARD_ID=OldCardID; Dbms_output.put_line('TABLE1:'| to_Char(SQL%ROWCOUNT)); Update ZSGL set KPBH=NewCardID where KPBH=OldCardID; Dbms_output.put_line('TABLE2:'| to_Char(SQL%ROWCOUNT)); end; / 结果: Warning: Procedure created with compilation errors.SQL> show errors; Errors for PROCEDURE MODIFYCARDID:LINE/COL ERROR -------- ----------------------------------------------------------------- 10/55 PLS-00103: Encountered the symbol ")" when expecting one of the following: . ( * % & | - + / mod range rem => .. an exponent (**) ||12/55 PLS-00103: Encountered the symbol ")" when expecting one of the following: . ( * % & | - + / mod range rem => .. an exponent (**) ||
OldCardID G_CARDS.CARD_ID%Type,
NewCardID G_CARDS.CARD_ID%Type,
Update1Row Out Number,
Update2Row Out Number
)
Is
begin
Update G_CARDS set CARD_ID=NewCardID where CARD_ID=OldCardID;
Dbms_output.put_line('TABLE1:'| to_Char(SQL%ROWCOUNT));
Update ZSGL set KPBH=NewCardID where KPBH=OldCardID;
Dbms_output.put_line('TABLE2:'| to_Char(SQL%ROWCOUNT));
end;
/
结果:
Warning: Procedure created with compilation errors.SQL> show errors;
Errors for PROCEDURE MODIFYCARDID:LINE/COL ERROR
-------- -----------------------------------------------------------------
10/55 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. ( * % & | - + / mod range rem => .. an exponent (**) ||12/55 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
. ( * % & | - + / mod range rem => .. an exponent (**) ||
SQL> declare
2 RC INTEGER;
3 begin
4 update a set col1=col1+1;
5 RC:=SQL%ROWCOUNT;
6 dbms_output.put_line(RC);
7 end;
8 /
9PL/SQL 过程已成功完成。
v_up_count integer;
begin
update t01
set empno=8200
v_up_count:=sql%rowcount;
dbms_output.put_line('table update's'||v_up_count);
end;