Re: How to find the number of rows deleted

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: How to find the number of rows deleted
Дата
Msg-id dbgmqt$2ds$1@news.hub.org
обсуждение исходный текст
Ответ на How to find the number of rows deleted  ("Andrus" <eetasoft@online.ee>)
Ответы Re: How to find the number of rows deleted  (Paul Thomas <paul@tmsl.demon.co.uk>)
Список pgsql-general
My ODBC client is Microsoft Visual FoxPro

I ran delete command using its sqlexec() function like:

SQLEXEC(nConnhandle, "DELETE FROM mytable")

sqlexec()  function returns the result from ordinary select table in a
cursor  SQLRESULT

Unfortunately, no result is returned if DELETE command is executed.
There is no SQLRowCount function in FoxPro.

If Microsoft SQL server returns the number of rows from last command in a
variable something like @@RowCount.

I'm expecting that Postgres has connection level function like currval()
which returns the result of rows affected by last command. So I can execute

SELECT rowcount();

in Postgres.

I can retrieve the connection handle value but I don�t know hot to get the
row count from it.

Any idea ?

Andrus.

"Greg Patnude" <gpatnude@hotmail.com> wrote in message
news:dbgfg9$213i$1@news.hub.org...
> 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@online.ee> wrote in message
> news:dbg24r$27d4$1@news.hub.org...
>>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.
>>
>
>



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Error while vacuuming
Следующее
От: "Andrus"
Дата:
Сообщение: Re: How to find the number of rows deleted