Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL%ROWCOUNT with update statement
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C06944.08692518
Content-Type: text/plain;
charset="iso-8859-1"
Thanks Prakash for your response. I was unable to recreate it in his code too. I have no idea what he's trying to do... it's his problem now.
Thanks again
-----Original Message-----
From: Bala, Prakash [mailto:prakash.bala_at_cingular.com]
Sent: Monday, December 18, 2000 3:32 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: SQL%ROWCOUNT with update statement
Lisa, so far sql%rowcount has returned me the right values.
Prakash
-----Original Message-----
Sent: Monday, December 18, 2000 2:41 PM
To: Multiple recipients of list ORACLE-L
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."
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bala, Prakash INET: prakash.bala_at_cingular.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------_=_NextPart_001_01C06944.08692518 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printableReceived on Mon Dec 18 2000 - 16:44:05 CST
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: SQL%ROWCOUNT with update statement</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2>Thanks Prakash for your response. I was unable =
to recreate it in his code too. I have no idea what he's trying to = do... it's his problem now.</FONT></P>
<P><FONT SIZE=3D2>Thanks again</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Bala, Prakash [<A =
HREF=3D"mailto:prakash.bala_at_cingular.com">mailto:prakash.bala_at_cingular.c= om</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, December 18, 2000 3:32 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Subject: RE: SQL%ROWCOUNT with update =
statement</FONT>
</P>
<BR>
<P><FONT SIZE=3D2>Lisa, so far sql%rowcount has returned me the right =
values.</FONT>
<BR><FONT SIZE=3D2> </FONT>
<BR><FONT SIZE=3D2>Prakash</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, December 18, 2000 2:41 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=3D2>Hello all, </FONT>
</P>
<P><FONT SIZE=3D2>One of the developers here is having trouble using =
this cursor attribute.</FONT>
<BR><FONT SIZE=3D2>He swears up and down the statement is correct and =
should be updating rows.</FONT>
<BR><FONT SIZE=3D2>I tried to recreate his problem and wasn't able =
to. Below is an example of</FONT>
<BR><FONT SIZE=3D2>the type of code I'm referencing. </FONT>
</P>
<P><FONT SIZE=3D2>Has anyone ever seen the implicit cursor attributes =
screw up and return</FONT>
<BR><FONT SIZE=3D2>wrong values? I don't believe I ever =
have. </FONT>
<BR><FONT SIZE=3D2>Any responses are appreciated. </FONT>
</P>
<P><FONT SIZE=3D2>Thanks </FONT>
</P>
<P><FONT SIZE=3D2>SQL> l </FONT>
<BR><FONT SIZE=3D2> 1 declare </FONT>
<BR><FONT SIZE=3D2> 2 ln_rowcount NUMBER; </FONT>
<BR><FONT SIZE=3D2> 3 ln_dummy DATE; </FONT>
<BR><FONT SIZE=3D2> 4 BEGIN </FONT>
<BR><FONT SIZE=3D2> 5 UPDATE BIN_LIST </FONT>
<BR><FONT SIZE=3D2> 6 SET LAST_MOD_TMSTMP =3D SYSDATE; =
</FONT>
<BR><FONT SIZE=3D2> 7 LN_ROWCOUNT :=3D SQL%ROWCOUNT; =
</FONT>
<BR><FONT SIZE=3D2> 8 DBMS_OUTPUT.PUT_LINE(ln_rowcount); =
</FONT>
<BR><FONT SIZE=3D2> 9 COMMIT; </FONT>
<BR><FONT SIZE=3D2> 10 LN_ROWCOUNT :=3D SQL%ROWCOUNT; =
</FONT>
<BR><FONT SIZE=3D2> 11 DBMS_OUTPUT.PUT_LINE(ln_rowcount); =
</FONT>
<BR><FONT SIZE=3D2> 12 </FONT>
<BR><FONT SIZE=3D2> 13 select sysdate into ln_dummy from =
dual; </FONT>
<BR><FONT SIZE=3D2> 14 LN_ROWCOUNT :=3D SQL%ROWCOUNT; =
</FONT>
<BR><FONT SIZE=3D2> 15 DBMS_OUTPUT.PUT_LINE(ln_rowcount); =
</FONT>
<BR><FONT SIZE=3D2> 16 </FONT>
<BR><FONT SIZE=3D2> 17 </FONT>
<BR><FONT SIZE=3D2> 18* END; </FONT>
<BR><FONT SIZE=3D2>SQL> / </FONT>
<BR><FONT SIZE=3D2>3062 </FONT>
<BR><FONT SIZE=3D2>3062 </FONT>
<BR><FONT SIZE=3D2>1 </FONT>
</P>
<P><FONT SIZE=3D2>PL/SQL procedure successfully completed. </FONT>
</P>
<P><FONT SIZE=3D2>SQL> </FONT>
</P>
<P><FONT SIZE=3D2>Lisa Rutland Koivu </FONT>
<BR><FONT SIZE=3D2>Oracle Database Administrator </FONT>
<BR><FONT SIZE=3D2>Qode.com </FONT>
<BR><FONT SIZE=3D2>4850 North State Road 7 </FONT>
<BR><FONT SIZE=3D2>Suite G104 </FONT>
<BR><FONT SIZE=3D2>Fort Lauderdale, FL 33319 </FONT>
</P>
<P><FONT SIZE=3D2>V: 954.484.3191, x174 </FONT>
<BR><FONT SIZE=3D2>F: 954.484.2933 </FONT>
<BR><FONT SIZE=3D2>C: 954.658.5849 </FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.qode.com" =
TARGET=3D"_blank">http://www.qode.com</A> <<A = HREF=3D"http://www.qode.com" = TARGET=3D"_blank">http://www.qode.com</A>> </FONT>
</P>
<P><FONT SIZE=3D2>"The information contained herein does not =
express the opinion or position</FONT>
<BR><FONT SIZE=3D2>of Qode.com and cannot be attributed to or made =
binding upon Qode.com."</FONT>
</P>
<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" = TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Bala, Prakash</FONT>
<BR><FONT SIZE=3D2> INET: prakash.bala_at_cingular.com</FONT>
</P>
<P><FONT SIZE=3D2>Fat City Network Services -- (858) =
538-5051 FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------= -----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an =
E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru_at_fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB =
ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed =
![]() |
![]() |