Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL%ROWCOUNT with update statement
Lisa, so far sql%rowcount has returned me the right values.
Prakash
-----Original Message-----
From: Koivu, Lisa [mailto:lkoivu_at_qode.com]
Sent: Monday, December 18, 2000 2:41 PM
To: Multiple recipients of list ORACLE-L
Subject: SQL%ROWCOUNT with update statement
Hello all,
One of the developers here is having trouble using this cursor attribute. He swears up and down the statement is correct and should be updating rows. I tried to recreate his problem and wasn't able to. Below is an example of the type of code I'm referencing.
Has anyone ever seen the implicit cursor attributes screw up and return wrong values? I don't believe I ever have. Any responses are appreciated.
Thanks
SQL> l
1 declare
2 ln_rowcount NUMBER;
3 ln_dummy DATE;
4 BEGIN
5 UPDATE BIN_LIST
6 SET LAST_MOD_TMSTMP = SYSDATE;
7 LN_ROWCOUNT := SQL%ROWCOUNT;
8 DBMS_OUTPUT.PUT_LINE(ln_rowcount);
9 COMMIT;
10 LN_ROWCOUNT := SQL%ROWCOUNT;
11 DBMS_OUTPUT.PUT_LINE(ln_rowcount);
12
13 select sysdate into ln_dummy from dual;
14 LN_ROWCOUNT := SQL%ROWCOUNT;
15 DBMS_OUTPUT.PUT_LINE(ln_rowcount);
16
17
18* END;
SQL> /
3062
3062
1
PL/SQL procedure successfully completed.
SQL>
Lisa Rutland Koivu
Oracle Database Administrator
Qode.com
4850 North State Road 7
Suite G104
Fort Lauderdale, FL 33319
V: 954.484.3191, x174 F: 954.484.2933 C: 954.658.5849
"The information contained herein does not express the opinion or position of Qode.com and cannot be attributed to or made binding upon Qode.com." Received on Mon Dec 18 2000 - 14:27:03 CST
![]() |
![]() |