get value after updating table - Mailing list pgsql-general

From Alain Roger
Subject get value after updating table
Date
Msg-id 75645bbb0703261238i531e44b0yf7242c9e664906b9@mail.gmail.com
Whole thread Raw
Responses Re: get value after updating table  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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.

however, i can i do that ? I mean how can i know if UPDATE has been correctly executed ?

here is my function :
CREATE OR REPLACE FUNCTION sp_a_005("login" "varchar", pwd "varchar")
  RETURNS boolean AS
$BODY$

DECLARE
 
BEGIN
    UPDATE accounts
    SET account_pwd = $2
    WHERE account_login = $1;
RETURN;

END;



--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5

pgsql-general by date:

Previous
From: Jesse Cleary
Date:
Subject: Could not create relation: File exists error
Next
From: "Martin Gainty"
Date:
Subject: Re: get value after updating table