Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: tableau procédure


  • From: "thomas.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: Sun, 20 Nov 2005 14:00:16 +0100
  • Message-id: <43807360(dot)3060004(at)laposte(dot)net>

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
>




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group