On Wed, 23 Feb 2005, Cristian Prieto wrote:
> RETURNS SETOF Users gave me:
>
> getuser
> -
> (cristian,hola)
>
Yes, it's ok, but for SETOF function You have to use different style of
calling SELECT * FROM getuser(...). If function call in normal centext
then SRF function
RETURNS SETOF Users gave me:
getuser
-
(cristian,hola)
- Original Message -
From: "Richard Huxton"
To: "Pavel Stehule" <[EMAIL PROTECTED]>
Cc: "Cristian Prieto" <[EMAIL PROTECTED]>;
Sent: Wednesday, February 23, 2005 10:34
Pavel Stehule wrote:
If I did the following:
SELECT * FROM "Users";
I get:
userid | passwd
--+
cristian | hola
AND I execute:
SELECT getuser('cristian', 'hola');
I get:
getuser
-
(cristian,hola)
There are two posibilities
SELECT getuser('cristian','hola');
SELEC
>
> If I did the following:
> SELECT * FROM "Users";
> I get:
>
> userid | passwd
> --+
> cristian | hola
>
> AND I execute:
> SELECT getuser('cristian', 'hola');
>
> I get:
> getuser
> -
> (cristian,hola)
>
There are two posibilities
SELECT getuser('cr
ot;Users"
but inside a SP, how could I do it?
- Original Message -
From: "Jan Poslusny"
To: "Cristian Prieto" <[EMAIL PROTECTED]>
Cc:
Sent: Wednesday, February 23, 2005 8:36 AM
Subject: Re: [GENERAL] Help with a very newbie question...
1.
Plpgsql-function can retu
hanks a lot for your help...
- Original Message - From: "Jan Poslusny"
To: "Cristian Prieto" <[EMAIL PROTECTED]>
Cc:
Sent: Wednesday, February 23, 2005 6:44 AM
Subject: Re: [GENERAL] Help with a very newbie question...
I think that sql-functions m
5 6:44 AM
Subject: Re: [GENERAL] Help with a very newbie question...
I think that sql-functions may serve as parametrized views for you...
http://www.postgresql.org/docs/8.0/static/xfunc-sql.html
Cristian Prieto wrote:
I want to create a view or a sp which returns NULL if nothing is found
and a re
I think that sql-functions may serve as parametrized views for you...
http://www.postgresql.org/docs/8.0/static/xfunc-sql.html
Cristian Prieto wrote:
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_ge
On Feb 23, 2005, at 6:14 AM, Andre Schnoor wrote:
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$
LAN
>>>
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
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
11 matches
Mail list logo