Home » SQL & PL/SQL » SQL & PL/SQL » how to know whether an update or insert happened due to an insert or update statement
how to know whether an update or insert happened due to an insert or update statement [message #192106] Sun, 10 September 2006 23:57 Go to next message
uday.y
Messages: 2
Registered: September 2006
Location: india
Junior Member

Hi,

How can i know whether an update or insert happened due to an update or insert statement.

I want to know how many rows were updated due to the update statement.
Re: how to know whether an update or insert happened due to an insert or update statement [message #192112 is a reply to message #192106] Mon, 11 September 2006 00:27 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,

 you can use rowcount.


regards,
Re: how to know whether an update or insert happened due to an insert or update statement [message #192113 is a reply to message #192106] Mon, 11 September 2006 00:39 Go to previous messageGo to next message
venkatbollu
Messages: 53
Registered: April 2005
Location: Bangalore
Member

Hi,

Use the following statement after the insert or update statement

IF SQL%rowcount >0 THEN
   DBMS_OUTPUT.PUT_LINE ( 'SQL%rowcount= ' || SQL%rowcount );
END IF;


Thks & Rgds
Venkat
Re: how to know whether an update or insert happened due to an insert or update statement [message #192123 is a reply to message #192113] Mon, 11 September 2006 01:47 Go to previous message
uday.y
Messages: 2
Registered: September 2006
Location: india
Junior Member

Thank you,
Previous Topic: local system logon as sysdba
Next Topic: inserting into table row-by-row.
Goto Forum:
  


Current Time: Sat Dec 14 16:40:59 CST 2024