Re: tableau procédure

From: "thomas(dot)silvi" <thomas(dot)silvi(at)laposte(dot)net>
To: david forums <dforums(at)vieonet(dot)com>
Cc: pgsql-fr-generale(at)postgresql(dot)org
Subject: Re: tableau procédure
Date: 2005-11-20 13:00:16
Message-ID: 43807360.3060004@laposte.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-fr-generale

david forums a écrit :

> bonjour
>
> Savez s'il est possible de prendre en argument d'une procédure un
> tableau.
>
oui. lire la section 37.1.2. Arguments Supportés et Types de Données
Résultats

par exemple sur
http://traduc.postgresqlfr.org/pgsql-7.4.9-fr/plpgsql.html#PLPGSQL-ARGS-RESULTS

> J'aimerai créé une function du type :
> CREATE FUNCTION CHECKIPVALIDITY ( inet in_ip, varchar[] in_data,
> varchar in_table)
> RETURNS boolean
> AS ''
>
Sous PostgreSQL 8.0.1, ce bout de de code fonctionne :

CREATE OR REPLACE FUNCTION CHECKIPVALIDITY (inet, varchar[], varchar)
RETURNS BOOLEAN AS
$$
DECLARE
in_ip ALIAS FOR $1;
in_data ALIAS FOR $2;
in_table ALIAS FOR $3;
tmp VARCHAR;
BEGIN

tmp := in_data[1];

RAISE NOTICE 'DEBUG: %', tmp;

RETURN (TRUE);
END
$$ LANGUAGE 'plpgsql';

SELECT CHECKIPVALIDITY('127.0.0.1', '{"abc", "def"}', 'matable');

Bonne journee,

Thomas

> merci
>
> David
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

In response to

Responses

Browse pgsql-fr-generale by date

  From Date Subject
Next Message Mathieu Arnold 2005-11-20 13:02:48 Re: IF EXISTS
Previous Message david techer 2005-11-20 12:53:48 Re: IF EXISTS