Search Postgresql Archives

Re: get value after updating table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux