getting number of rows updated within a procedure

Поиск
Список
Период
Сортировка
От Dan Langille
Тема getting number of rows updated within a procedure
Дата
Msg-id 200101141019.XAA47026@ducky.nz.freebsd.org
обсуждение исходный текст
Список pgsql-general
I'm writing a procedure and I want to check the number of rows updated.
  But I can't figure out how.  I know UPDATE returns "UPDATE #" but I
don't know how to use that to get what I need.

Here's an example:

CREATE FUNCTION "test" () RETURNS int AS '
DECLARE
        v_number_of_rows int;

BEGIN
          update bigtable
          set email_confirmed = 1
          where user_group  = 1234;

-- and here, I want to know the number of rows updated
         v_number_of_rows := *what?*;

END;
' LANGUAGE 'plpgsql';


Thanks.

--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/
       FreshPorts - http://freshports.org/
     NZ Broadband - http://unixathome.org/broadband/

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

Предыдущее
От: Patricia_Leong@tecsg.com.sg
Дата:
Сообщение: SQL command for value comparison
Следующее
От: Tod McQuillin
Дата:
Сообщение: Re: where to host??