Re: ecpg and multiple connections

From: Jason Davis <jdavis(at)tassie(dot)net(dot)au>
To: edx(at)land(dot)waw(dot)pl
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ecpg and multiple connections
Date: 2001-10-19 23:57:59
Message-ID: 200110192356.f9JNuK166304@perseus.tassie.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Medve Gábor 2001-10-20 09:50:44 Performance question (PostgreSQL 7.1.3)
Previous Message Joel Burton 2001-10-19 20:46:34 Re: Connect to pg via tcpip