Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Connecting to non-default database in Oracle 7
There are two methods of connecting to multiple databases within embedded sql.
If you dont need to be connected to different databases at the same time then
you can use the normal exec sql connect :USERNAME identified by :PASSWORD using
:SERVER.
You must then issue an exec sql COMMIT WORK RELEASE before issuing another exec
sql statement to connect to your other database. This method is useful if you
do not want to hardcode your databases.
The other method is to declare the databases you are going to connect to, in
embedded c.
This is documented in the pro*c manual.
Keith Jamieson
Robert Yang wrote:
> Hi,
>
> We are porting from MS SQL Server 6.5 to Oracle 7.3 and are quite
> confused, as you might expect, so please bear with me 8)
>
> There is a concept in SQL Server of multiple databases on a given
> server which can contain the same schema (tables, stored procedures, etc.).
> When connecting with DB-Lib, the dbuse() API can be used to set the
> desired default database, so that SQL commands like
> "Select Name from My_Table" can be executed.
>
> However, I cannot see how to do this with OCI or even Embedded SQL.
> It would seem that the database name must be specified for non-default
> databases, e.g. "Select Name from MyDatabase.MyTable".
>
> Any insight would be appreciated !
> --
> Rob Yang
> Sr. Software Engineer
> San Jose, CA, USA
Received on Wed Apr 22 1998 - 00:00:00 CDT
![]() |
![]() |