Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL%ROWCOUNT with update statement

RE: SQL%ROWCOUNT with update statement

From: Praveen Sahni <praveensahni_at_emirates.com>
Date: Tue, 19 Dec 2000 08:00:49 +0400
Message-Id: <10714.124892@fatcity.com>


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_01C06970.4589DB50
Content-Type: text/plain;

        charset="iso-8859-1"

Hi,  

Its working fine what is the problem ............  

Praveen

-----Original Message-----
From: Koivu, Lisa [mailto:lkoivu_at_qode.com] Sent: 18 December 2000 23:41
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 

http://www.qode.com <http://www.qode.com>

"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."

------_=_NextPart_001_01C06970.4589DB50
Content-Type: text/html;

        charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>SQL%ROWCOUNT with update statement</TITLE>

<META content="MSHTML 5.00.3019.2500" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=745295903-19122000>Hi,</SPAN></FONT></DIV> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=745295903-19122000></SPAN></FONT>&nbsp;</DIV> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=745295903-19122000>Its working fine what is the problem ............</SPAN></FONT></DIV> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=745295903-19122000></SPAN></FONT>&nbsp;</DIV> <DIV><FONT color=#0000ff face=Arial size=2><SPAN class=745295903-19122000>Praveen</SPAN></FONT></DIV> <BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader><FONT face="Times New Roman"
  size=2>-----Original Message-----<BR><B>From:</B> Koivu, Lisa 
  [mailto:lkoivu_at_qode.com]<BR><B>Sent:</B> 18 December 2000 23:41<BR><B>To:</B> 
  Multiple recipients of list ORACLE-L<BR><B>Subject:</B> SQL%ROWCOUNT with 
  update statement<BR><BR></DIV></FONT>
<P><FONT face=Arial size=2>Hello all, </FONT></P>
<P><FONT face=Arial size=2>One of the developers here is having trouble using
  this cursor attribute.&nbsp; He swears up and down the statement is correct   and should be updating rows.&nbsp; I tried to recreate his problem and wasn't   able to.&nbsp; Below is an example of the type of code I'm referencing.
</FONT></P>
<P><FONT face=Arial size=2>Has anyone ever seen the implicit cursor attributes
  screw up and return wrong values?&nbsp; I don't believe I ever have.&nbsp;
</FONT><BR><FONT face=Arial size=2>Any responses are appreciated. </FONT></P>
<P><FONT face=Arial size=2>Thanks</FONT> </P>
<P><FONT face="Courier New" size=2>SQL&gt; l</FONT> <BR><FONT
  face="Courier New" size=2>&nbsp; 1&nbsp; declare</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp; 2&nbsp; ln_rowcount NUMBER;</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp; 3&nbsp; ln_dummy DATE;</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp; 4&nbsp; BEGIN</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp; 5&nbsp; UPDATE BIN_LIST</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp; 6&nbsp; SET LAST_MOD_TMSTMP = SYSDATE;</FONT> 

<BR><FONT face="Courier New" size=2>&nbsp; 7&nbsp; LN_ROWCOUNT :=
  SQL%ROWCOUNT;</FONT> <BR><FONT face="Courier New" size=2>&nbsp; 8&nbsp;   DBMS_OUTPUT.PUT_LINE(ln_rowcount);</FONT> <BR><FONT face="Courier New"
  size=2>&nbsp; 9&nbsp; COMMIT;</FONT> <BR><FONT face="Courier New" 
  size=2>&nbsp;10&nbsp; LN_ROWCOUNT := SQL%ROWCOUNT;</FONT> <BR><FONT 
  face="Courier New" size=2>&nbsp;11&nbsp; 
  DBMS_OUTPUT.PUT_LINE(ln_rowcount);</FONT> <BR><FONT face="Courier New"   size=2>&nbsp;12</FONT> <BR><FONT face="Courier New" size=2>&nbsp;13&nbsp;   select sysdate into ln_dummy from dual;</FONT> <BR><FONT face="Courier New"   size=2>&nbsp;14&nbsp; LN_ROWCOUNT := SQL%ROWCOUNT;</FONT> <BR><FONT   face="Courier New" size=2>&nbsp;15&nbsp;   DBMS_OUTPUT.PUT_LINE(ln_rowcount);</FONT> <BR><FONT face="Courier New"   size=2>&nbsp;16</FONT> <BR><FONT face="Courier New" size=2>&nbsp;17</FONT>
<BR><FONT face="Courier New" size=2>&nbsp;18* END;</FONT> <BR><FONT
  face="Courier New" size=2>SQL&gt; /</FONT> <BR><FONT face="Courier New" 
  size=2>3062</FONT> <BR><FONT face="Courier New" size=2>3062</FONT> <BR><FONT 
  face="Courier New" size=2>1</FONT> </P>

<P><FONT face="Courier New" size=2>PL/SQL procedure successfully
  completed.</FONT> </P>
<P><FONT face="Courier New" size=2>SQL&gt;</FONT> </P>
<P><B><FONT face=Arial size=1>Lisa Rutland Koivu</FONT></B> <BR><FONT
  face=Arial size=1>Oracle Database Administrator</FONT> <BR><FONT face=Arial   size=1>Qode.com</FONT> <BR><FONT face=Arial size=1>4850 North State Road   7</FONT> <BR><FONT face=Arial size=1>Suite G104</FONT> <BR><FONT face=Arial   size=1>Fort Lauderdale, FL&nbsp; 33319</FONT> </P>
<P><FONT face=Arial size=1>V: 954.484.3191, x174</FONT> <BR><FONT face=Arial
  size=1>F: 954.484.2933 </FONT><BR><FONT face=Arial size=1>C:   954.658.5849</FONT> <BR><FONT face=Arial size=1><A href="http://www.qode.com"   target=_blank>http://www.qode.com</A></FONT> </P>
<P><I><FONT color=#000000 face=Arial size=1>"The information contained herein
  does not express the opinion or position of Qode.com and cannot be attributed Received on Mon Dec 18 2000 - 22:00:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US