Home » SQL & PL/SQL » SQL & PL/SQL » Does Commit Close the Implicit Cursor? (Oracle 9i and above, Unix Sun Solaris 5.8)
Does Commit Close the Implicit Cursor? [message #492947] Thu, 03 February 2011 19:20 Go to next message
atgramesh
Messages: 23
Registered: January 2011
Junior Member
Hi,

We all know that commit will do the following.

1. Save the Txn Permanently to the database.
2. Release the table locks and
3. Erase the save points.

TABLE NAME:
==========
create table TEST_PREC (NO NUMBER(4,2));

DECLARE
BEGIN
INSERT INTO TEST_PREC VALUES (12.34);
DBMS_OUTPUT.PUT_LINE('the no of records before commit '||SQL%ROWCOUNT);
commit; /* What's happening inside commit */
DBMS_OUTPUT.PUT_LINE('the no of records after commit '||SQL%ROWCOUNT);
END;

SQL> /
the no of records before commit 1
the no of records after commit 0

My question is why the SQL%ROWCOUNT is set to zero
after commit.

Does the commit, close the implicit cursor?

Thanks and Regards,
Ramesh V
Re: Does Commit Close the Implicit Cursor? [message #492948 is a reply to message #492947] Thu, 03 February 2011 19:58 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>My question is why the SQL%ROWCOUNT is set to zero after commit.
This is how Oracle is implemented.
Accept reality & worry about something you can control.
Re: Does Commit Close the Implicit Cursor? [message #492949 is a reply to message #492948] Thu, 03 February 2011 20:11 Go to previous messageGo to next message
atgramesh
Messages: 23
Registered: January 2011
Junior Member
Thanks Swann for quick revert.

Why i have aksed the question is here i am not aware
of the what commit exactly does here.

What would be the possibilities for commit?
If anyone have the link, please post the same.

Warm Regards,
Ramesh V
Re: Does Commit Close the Implicit Cursor? [message #492961 is a reply to message #492947] Thu, 03 February 2011 23:20 Go to previous message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
My question is why the SQL%ROWCOUNT is set to zero
after commit.

Because "commit" affects no row.
RSQL%OWCOUNT is clear at the beginning of each statement.

Regards
Michel

[Updated on: Thu, 03 February 2011 23:21]

Report message to a moderator

Previous Topic: Restriction on Commit
Next Topic: Nested cursors
Goto Forum:
  


Current Time: Sat Aug 30 16:25:20 CDT 2025