Home » Developer & Programmer » Precompilers, OCI & OCCI » URGENT:-Need to connect to remote database in PRO*C
URGENT:-Need to connect to remote database in PRO*C [message #169264] Tue, 25 April 2006 23:58 Go to next message
milind_sri
Messages: 70
Registered: February 2005
Location: Pune
Member
Hi Gurus,

I am working with PRO*C and I have a problem like this.

The oracle database is on NT box and PRO*C will need to connect to the database via SQL NET .

I’m looking at the pro*C code and every where there is implicit oracle database connection via the ORACLE_SID .

Is there a way out with out touching the PRO*C
we set the default connection to a remote database.

The only way I have figured it out is changing the Pro*c files which is painful though its just replacing EXEC SQL CONNECT Statement .

Need to connect to a remote database node with out explicitly using the net name in the client application.

Please let me know how to do this as this is urgent.

Thanks in Advance.

Milind.
Re: URGENT:-Need to connect to remote database in PRO*C [message #169765 is a reply to message #169264] Fri, 28 April 2006 10:49 Go to previous message
denis.flotat
Messages: 13
Registered: September 2005
Junior Member
You never access a database thru its ORACLE_SID but thru its alias defined in TNSNAMES.ORA.

You set an alias in your code but that alias can point to different DB (depending on the configuration of the alias in the TNSNAMES.ORA file) without the need to recompile your application.

Tnsnames.ora file works the same as the .hosts file that specify an alias for a given IP address. Here you specify an alias for a remote DB (identified by its IP address and ORACLE_SID).
That file can be different from different clients using the same executable application.

Regards.


Previous Topic: Execute Pro*c application on client
Next Topic: OCI version 10.2.0.1.0 is not supported
Goto Forum:
  


Current Time: Sun Dec 22 01:26:08 CST 2024