Number of rows deleted? [message #43146] |
Fri, 13 June 2003 08:28  |
Matt Henderson
Messages: 1 Registered: June 2003
|
Junior Member |
|
|
If I issue this query in sqlplus it tells me the number of rows that have been deleted:
SQL> delete from big_table
2 where col1 = 'P';
23 rows deleted.
....but if the query is part of a plsql block it doesn't output the number of rows deleted. Is there any inbuilt Oracle functionality for outputting this information? I could do a row count on the table before and after the delete and then output the number of rows deleted using dbms_output, but am hoping there is a better way.
Many thanks,
Matt
|
|
|
Re: Number of rows deleted? [message #43147 is a reply to message #43146] |
Fri, 13 June 2003 08:38  |
Suraj K
Messages: 5 Registered: January 2003
|
Junior Member |
|
|
begin
delete table xyz
where ... ;
dbms_output.put_line('rows deleted: '||sql%rowcount);
end;
Note: You can use this implicit cursor functionality for deriving the counts for inserts/updates as well.
Hope this helps.
Cheers.
|
|
|