Re: ecpg and multiple connections - Mailing list pgsql-novice

From Jason Davis
Subject Re: ecpg and multiple connections
Date
Msg-id 200110192356.f9JNuK166304@perseus.tassie.net.au
Whole thread Raw
In response to ecpg and multiple connections  (Edward Pilipczuk <edx@zeng.uranos.eu.org>)
List pgsql-novice
>I have problem in my application.
>I must handle queries to multiple databases concurrently.
>In a documentation set there is only information how to open named
>connections in order to differentiate them.
>In documantaion the query statements 'EXEC SQL SELECT ...'
>does not provide interface for the connection name.
>ECPGdo has the second aprameters set to NULL, what is the purpose of
>this parameter ?  Connection name ? Other object type ?

If I read you correctly, the syntax you are after is

EXEC SQL CONNECT TO db1 AS conn1;
EXEC SQL CONNECT TO db2 AS conn2;

EXEC SQL AT db1 SQL_STATEMENTS;
EXEC SQL AT db2 SQL_STATEMENTS;

EXEC SQL DISCONNECT db1;
EXEC SQL DISCONNECT db2;

Hope this helps.

cheers,
Jason Davis



pgsql-novice by date:

Previous
From: Joel Burton
Date:
Subject: Re: Connect to pg via tcpip
Next
From: Vijay Deval
Date:
Subject: Re: Problem with createdb & case (7.1.3)