Re: get value after updating table

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: get value after updating table
Дата
Msg-id 20070326210012.GB28954@svana.org
обсуждение исходный текст
Ответ на get value after updating table  ("Alain Roger" <raf.news@gmail.com>)
Список pgsql-general
On Mon, Mar 26, 2007 at 09:38:07PM +0200, Alain Roger wrote:
> Hi,
>
> I wrote a function which should update a table field.
> However, i would like somehow to control that update was done.
> for that i was thinking to return a boolean : true is update was done, false
> if an error happened.

I beleive in recent versions you can do things like:
>    UPDATE accounts
>    SET account_pwd = $2
>    WHERE account_login = $1
RETURNING account_id;

If it updated it would return the ID of the row updated...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Ron
Дата:
Сообщение: A (hopefully) simple question re: secure pg <=> web application access
Следующее
От: "Martin Gainty"
Дата:
Сообщение: Re: A (hopefully) simple question re: secure pg <=> web application access