Re: How to find the number of rows deleted

From: "Greg Patnude" <gpatnude(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to find the number of rows deleted
Date: 2005-07-18 14:55:38
Message-ID: dbgfg9$213i$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

After an application updates, deletes, or inserts rows, it can call
SQLRowCount to determine how many rows were affected. SQLRowCount returns
this value whether or not the rows were updated, deleted, or inserted by
executing an UPDATE, DELETE, or INSERT statement, by executing a positioned
update or delete statement, or by calling SQLSetPos.

If a batch of SQL statements is executed, the count of affected rows might
be a total count for all statements in the batch or individual counts for
each statement in the batch. For more information, see Batches of SQL
Statements and Multiple Results.

The number of affected rows is also returned in the SQL_DIAG_ROW_COUNT
diagnostic header field in the diagnostic area associated with the statement
handle. However, the data in this field is reset after every function call
on the same statement handle, whereas the value returned by SQLRowCount
remains the same until a call to SQLBulkOperations, SQLExecute,
SQLExecDirect, SQLPrepare, or SQLSetPos.

And Tom is right....

"Andrus" <eetasoft(at)online(dot)ee> wrote in message
news:dbg24r$27d4$1(at)news(dot)hub(dot)org(dot)(dot)(dot)
>I ran DELETE command from my ODBC client application.
> I want to get the number of rows deleted by this DELETE command.
>
> I read the DELETE command docs but havent found any function.
>
> Any idea ?
>
> Andrus.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-07-18 14:56:20 Re: Changes to not deferred FK in 8.0.3 to 7.4?
Previous Message Janning Vygen 2005-07-18 14:52:04 Re: Changes to not deferred FK in 8.0.3 to 7.4?