473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to find no.of deleted rows

Whenever delete is performed on a DB2 database, it just returns
"...command completed successfully.."
db2 =select count(*) from sales
1
-----------
12
1 record(s) selected.

db2 =delete from sales
DB20000I The SQL command completed successfully.

Is there a method available to find the no of records it indeed
delete ?

Aug 2 '07 #1
2 9700
Sam Durai wrote:
Whenever delete is performed on a DB2 database, it just returns
"...command completed successfully.."
db2 =select count(*) from sales
1
-----------
12
1 record(s) selected.

db2 =delete from sales
DB20000I The SQL command completed successfully.

Is there a method available to find the no of records it indeed
delete ?
Teh SQLCA.ERRD(3) field contains tehnumber of rows deleted.
In an SQL Procedure you get it with:
GET DIAGNOSTICS <var= ROW_COUNT

Or:
SELECT COUNT(*) FROM OLD TABLE(DELETE FROM sales);

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Aug 2 '07 #2
Lew
when using the clp you can use the -a option which shows the sqlca:
db2 -a "delete from sales"

On Aug 2, 2:29 pm, Sam Durai <reachsamdu...@gmail.comwrote:
Whenever delete is performed on a DB2 database, it just returns
"...command completed successfully.."
db2 =select count(*) from sales
1
-----------
12
1 record(s) selected.

db2 =delete from sales
DB20000I The SQL command completed successfully.

Is there a method available to find the no of records it indeed
delete ?

Aug 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ashish | last post by:
Hi, I am not able to find out the Delta XML. Requirement Spec: If I have a file with <ID>101</ID> <Name>BOB</Name> I want to add the changes made to the file like rows added , removed and...
2
by: raffe | last post by:
Hi all. I'm struggeling with a problem. I trying to do something very simple. I have a DataSet containing two tables TableA and TableB. I use TableA.GetChildren("relationName") in order to get...
5
by: Albert | last post by:
Does anyone know if it is possible to get information out of a datarow which has been deleted? Thanks, Albert
3
by: Zorpiedoman | last post by:
Is this true: An existing row in a data table that is deleted still exists in the rows collection, but it is marked as deleted (rowstate = deleted) But If a row that was added to the data...
3
by: taru | last post by:
Env: DB2 UDB 8.1 on AIX We are executing a db2 sql stored procedure which is invoked from a java client. The stored procedure contains few select, insert and update statements. Using the DB2...
0
by: Tony Johansson | last post by:
Hello! I have a very specific question and that is about how to inherit a visual control for example the control System.Windows.Forms.TextBox without causing the environment to delete the...
4
by: Joris De Groote | last post by:
Hi, (my code is @ the bottom of this message) I have a piece of code that runs the rows of a dataset until it finds the one needed. When he finds it, I delete that row and start all over...
4
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I have a DataTable with many rows. The user can delete a row. After the row is deleted, I'd like to column values for the deleted row, but any attempt to...
0
by: ZSvedic | last post by:
Hi all, I need to display DataRows with RowState.Deleted inside DataGridView, in a way that such rows have strikethrough font. Here is the screenshot how it should look like:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.