Help with a very newbie question...

Поиск
Список
Период
Сортировка
От Cristian Prieto
Тема Help with a very newbie question...
Дата
Msg-id 014b01c51917$03dc2b30$6e00a8c0@gt.ClickDiario.local
обсуждение исходный текст
Ответы Re: Help with a very newbie question...  (Jan Poslusny <pajout@gingerall.cz>)
Список pgsql-general
I want to create a view or a sp which returns NULL if nothing is found and a recordset if the user is found
 
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?
 
Thanks a lot!

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

Предыдущее
От: Shachar Shemesh
Дата:
Сообщение: Re: ADO and timestamp/date errors
Следующее
От: Heather Johnson
Дата:
Сообщение: How to Prevent Certain Kinds of Joins?