Re: ecpg and multiple connections

Поиск
Список
Период
Сортировка
От Jason Davis
Тема Re: ecpg and multiple connections
Дата
Msg-id 200110192356.f9JNuK166304@perseus.tassie.net.au
обсуждение исходный текст
Ответ на ecpg and multiple connections  (Edward Pilipczuk <edx@zeng.uranos.eu.org>)
Список 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 по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: Connect to pg via tcpip
Следующее
От: Vijay Deval
Дата:
Сообщение: Re: Problem with createdb & case (7.1.3)