Re: How to tell if that UPDATE worked?

Поиск
Список
Период
Сортировка
Искать
От
Jan Wieck
Тема
Re: How to tell if that UPDATE worked?
Дата
Msg-id
200101112010.PAA04955@jupiter.jw.home
Ответ на
Список
Дерево обсуждения
How to tell if that UPDATE worked? <drevil@sidereal.kz>
Re: How to tell if that UPDATE worked? Jan Wieck <janwieck@Yahoo.com>
Re: How to tell if that UPDATE worked? Tom Lane <tgl@sss.pgh.pa.us>
Re: How to tell if that UPDATE worked? Bruce Momjian <pgman@candle.pha.pa.us>
Re: How to tell if that UPDATE worked? <drevil@sidereal.kz>
drevil@sidereal.kz wrote:
>
> I'm writing some stuff in PL/pgsql (actually, a lot of stuff).  I have
> a question: At various times, it does UPDATEs.  Is there a way to tell
> if the UPDATE actually affected any rows or not?  I couldn't see how
> to get UPDATE to return anything.

    Do a

        GET DIAGNOSTICS SELECT PROCESSED INTO ;

    directly  after  an  INSERT,  UPDATE  or DELETE statement and
    you'll know how many rows have been hit.

    Also you can get the OID of an inserted row with

        GET DIAGNOSTICS SELECT RESULT INTO ;

    Er - is this another added feature where we're still  lacking
    documentation?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


В списке pgsql-general по дате отправления
От: Dan Moschuk
Дата:
Сообщение: exit status 26
От: Jan Wieck
Дата:
FAQ