Getting a count from an update

Поиск
Список
Период
Сортировка
От Brian Hurt
Тема Getting a count from an update
Дата
Msg-id 4581AC83.2020509@janestcapital.com
обсуждение исходный текст
Ответы Re: Getting a count from an update  (Richard Broersma Jr <rabroersma@yahoo.com>)
Список pgsql-novice
Newbie question here: I want to be able to capture the count of the
number of rows updated from an update command within SQL.  I know that
psql prints out the result, I want to grab it within a function.  The
update is a simple "UPDATE tablename SET col = value WHERE othercol =
otherval;", which will generally update many dozens or hundreds of
rows.  Currently I'm doing a select before doing the update, but since
I'm doing a select count(*) I can't add a 'for update' to the end and
lock the rows.  Is there a better way to do this?

Brian


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

Предыдущее
От: Aarni Ruuhimäki
Дата:
Сообщение: Re: Upgrade to PGSQL 8.2 Problem
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: Getting a count from an update