Re: Function example

From: Masse Jacques <jacques(dot)masse(at)bordeaux(dot)cemagref(dot)fr>
To: 'Roberto de Amorim' <roberto(at)smartbit(dot)inf(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function example
Date: 2003-02-26 13:43:07
Message-ID: 0B87317EA62BD211A02A00A0C9DFB7EC9B5F10@hermes.bordeaux.cemagref.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)smartbit(dot)inf(dot)br]
Envoyé : mercredi 26 février 2003 13:55
À : pgsql-general(at)postgresql(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Patrik Kudo 2003-02-26 14:30:05 index usage (and foreign keys/triggers)
Previous Message Roberto de Amorim 2003-02-26 12:55:15 Function example