Re: multiple database connections in Pro*C

From: <sigdock_at_my-deja.com>
Date: Mon, 25 Sep 2000 07:42:07 GMT
Message-ID: <8qmvkc$nvr$1_at_nnrp1.deja.com>


Gary,

it should be no problem to connect to more than one database in Pro*C; I've done the same several years ago in Pro*Cobol connecting to six databases on three different servers. These connections were simultanious. Nice detail: we didn't have the Distributed Database option at that time so we had to build our own two-phase commit procedure.
Perhaps you need to check the exact syntax in the documentation but it looks familiar.
Regards,

BertJan Meinders
Oracle DBA
ASR-ICT
In article <01c0249b$8e990e20$61c80928_at_PC07AH6T64WC>,   "Gary Beckler" <gary_l_beckler_nonlilly_at_lilly.com> wrote:
> A Pro*C program has one database connection to a default database:
>
> EXEC SQL CONNECT :username1 IDENTIFIED BY :password1 USING
:db_string1
>
> I would like to add a second connection to a non-default database:
>
> EXEC SQL DECLARE DB_NAME DATABASE
> EXEC SQL CONNECT :username2 IDENTIFIED BY :password2 AT
 DB_NAME
> USING :db_string2
>
> Do I need to make the first connection a non-default database
 connection or
> can concurrent default and non-default database connections be used
> together?
>
> Also, can the
>
> EXEC SQL COMMIT RELEASE
>
> statement be used to close both connections or do I need two
 statements:
>
> EXEC SQL COMMIT RELEASE
> EXEC SQL COMMIT AT DB_NAME RELEASE
>
> --
> Gary Beckler
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Sep 25 2000 - 09:42:07 CEST

Original text of this message