From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Tovo Rabemanantsoa <tovo(at)bordeaux(dot)inra(dot)fr> |
Cc: | Pgsql Fr Generale <pgsql-fr-generale(at)postgresql(dot)org> |
Subject: | Re: Plsql et dblink |
Date: | 2008-07-23 13:47:33 |
Message-ID: | 48873675.3010100@lelarge.info |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-fr-generale |
Tovo Rabemanantsoa a écrit :
> [...]
> CREATE OR REPLACE FUNCTION populate_flux()
> RETURNS numeric AS
> $BODY$
> declare
> tuples record;
> begin
> FOR tuples IN SELECT toto FROM dblink('dbname=Base1', 'SELECT * FROM
> Flux1') as (toto record)
> LOOP
> RAISE NOTICE 'H2O = % et CO2 = % : %',tuples."H2O", tuples."CO2";
>
> END LOOP;
> return 0;
> end;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
>
> Et bien entendu, ça, ça ne marche pas.
C'est-à-dire ? en quoi cela ne fonctionne pas ? avez-vous un message
d'erreur ?
> Visiblement la partie "FOR tuples IN SELECT toto FROM
> dblink('dbname=Base1', 'SELECT * FROM Flux1') as (toto record)" n'est
> pas bon.
> Est-ce que quelqu'un pourrait me dire comment faire dans ce cas ?
> Merci d'avance.
>
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tovo Rabemanantsoa | 2008-07-23 14:22:32 | Re: Plsql et dblink |
Previous Message | Tovo Rabemanantsoa | 2008-07-23 13:08:43 | Plsql et dblink |