Search Postgresql Archives

Re: Help with a very newbie question...

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

 



>>>
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



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[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