Re: Help with a very newbie question...

From: "Andre Schnoor" <andre(dot)schnoor(at)web(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Help with a very newbie question...
Date: 2005-02-23 11:14:36
Message-ID: 3836pcF5j9147U1@individual.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>
I wrote something like:

CREATE sp_getuser(name, pass) RETURNS record AS
$body$
DECLARE
retval RECORD;
BEGIN
SELECT INTO retval * FROM Users WHERE userid=name AND passwd=pass;
IF NOT FOUND THEN
RETURN NULL;
ELSE
RETURN retval;
END;
$body$
LANGUAGE plpgsql;

What is wrong with that function? I guess I could create it as a View but I
don't know how to pass parameters in a view, somebody could help me with
this?
<<<

END IF; is missing after the ELSE statement. I often make this mistake too.

Andre

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Trewern 2005-02-23 12:06:25 Pg 8.0rc5 to 8.0.1 update
Previous Message Richard Huxton 2005-02-23 10:48:33 Re: Catching internal error ID's to throw custom errors.