From: Postgresql <frederes@free.fr>
To: pgsql-sql@postgresql.org
Subject: calling user defined function with parameters..
Date: Sat, 16 Jun 2001 14:56:17 +0200
Message-ID: <9gfklv$120h$1@news.tht.net> (raw)
Hi,
I've created a function like this :
CREATE FUNCTION tester(INT4)
RETURNS BOOL AS
'
DECLARE
r RECORD;
p ALIAS FOR $1;
BEGIN
SELECT INTO r
id_dpt
FROM dpts
WHERE id_dpt=p;
IF NOT FOUND THEN
RETURN FALSE;
ELSE
RETURN TRUE;
END IF;
END;
'
LANGUAGE 'plpgsql';
All is ok at creation.
But now , how can i use my function ? i would like a thing like :
SELECT tester(14) AS ok;
But is make a Postgresql parser error
How to do then ??
Thanks for any help or links (other than the postgresql.org website...) !
;)
Regards,
Fred
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: frederes@free.fr
Subject: Re: calling user defined function with parameters..
In-Reply-To: <9gfklv$120h$1@news.tht.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox