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: [pgsql-fr-generale] tableau procédure


  • From: "david bigand forum" <dforums(at)vieonet(dot)com>
  • To: <thomas(dot)silvi(at)laposte(dot)net>
  • Cc: <pgsql-fr-generale(at)postgresql(dot)org>
  • Subject: RE: [pgsql-fr-generale] tableau procédure
  • Date: Tue, 22 Nov 2005 10:51:37 +0100
  • Message-id: <000401c5ef4a$54bb8140$0400a8c0(at)david>

Bonjour

Et merci pour ces explications détaillées, en faite je me prenais la tête à
cause des tableaux sql qui commence à 1 et non à 0.

J'ai une autre question.

Dans ma procédure je construis dynamiquement une requête, comment pourrais
je faire pour voir le résultat de la construction de cette requête pour
vérifier si cette requête est correcte. Vers ou je peux faire un output et
comment/ou je peux le récupérer.

Cordialement

David 

-----Message d'origine-----
De : pgsql-fr-generale-owner(at)postgresql(dot)org
[mailto:pgsql-fr-generale-owner(at)postgresql(dot)org] De la part de thomas.silvi
Envoyé : dimanche 20 novembre 2005 14:00
À : david forums
Cc : pgsql-fr-generale(at)postgresql(dot)org
Objet : Re: [pgsql-fr-generale] tableau procédure

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-RESU
LTS

> 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
>


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster




Home | Main Index | Thread Index

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