Re: Function example - Mailing list pgsql-general

From Masse Jacques
Subject Re: Function example
Date
Msg-id 0B87317EA62BD211A02A00A0C9DFB7EC9B5F10@hermes.bordeaux.cemagref.fr
Whole thread Raw
In response to Function example  ("Roberto de Amorim" <roberto@smartbit.inf.br>)
List pgsql-general
Declarations with 2 int as parameters returning an int.
You use echnum1 and echnum2 as variable name in the body of the function


______
CREATE FUNCTION ps_desc(int4, int4) RETURNS int4 AS '
DECLARE id int4;
DECLARE echnum1 ALIAS FOR $1;
DECLARE echnum2 ALIAS FOR $2;
DECLARE nlignes integer;
_____
___________________________________________
Jacques Massé
Tel. 33 (0)5 57 89 08 11 - Fax 33 (0)5 57 89 08 01
___________________________________________




-----Message d'origine-----
De : Roberto de Amorim [mailto:roberto@smartbit.inf.br]
Envoyé : mercredi 26 février 2003 13:55
À : pgsql-general@postgresql.org
Objet : [GENERAL] Function example


could anyone send me an example of CREATE FINTION using 'plpgsql' as
language and using paramters (more then 1)?
please

I don't know how to manipulate the params into the function...

TIA

Roberto de Amorim


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

pgsql-general by date:

Previous
From: "Roberto de Amorim"
Date:
Subject: Function example
Next
From: Patrik Kudo
Date:
Subject: index usage (and foreign keys/triggers)