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

Re: Plsql et dblink

From: Sébastien Lardière <sebastien(at)lardiere(dot)net>
To:
Cc: Pgsql Fr Generale <pgsql-fr-generale(at)postgresql(dot)org>
Subject: Re: Plsql et dblink
Date: 2008-07-23 15:52:13
Message-ID: 488753AD.9040508@lardiere.net (view raw or flat)
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)

Bonjour,

Je ne pense pas que le (toto record) soit autorisé. Il faut renseigné 
toutes les colonnes et les types de données renvoyés par la requête 
"SELECT * FROM Flux1" =>

FOR tuples IN SELECT toto FROM dblink('dbname=Base1', 'SELECT * FROM 
Flux1') as ( "H20" int, "CO2" int, ... )

avec les types de données correspondants, bien-sûr.

-- 
Sébastien Lardière



In response to

pgsql-fr-generale by date

Next:From: damien clochardDate: 2008-07-23 17:54:37
Subject: Pgday.fr : Ouverture des inscriptions !
Previous:From: Daniel VeriteDate: 2008-07-23 15:05:02
Subject: Re: Plsql et dblink

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group