OCI Question
Date: 1996/11/19
Message-ID: <56t213$sje_at_news.eecs.uic.edu>#1/1
I have written a small C program, that attempts to connect to a DB-server (oracle7.3) on Host-B from Host-A, using OCI calls.
Here is a code sample:
/* ******************** Sample code begins *************************** */
text *uid1;
main()
{
Lda_Def lda; /* Logon data area */ ub1 hda[256]; /* Host data area */ Cda_Def cda; /* Cursor data area */
uid1 = (char *)malloc(80);
memset(uid1,80,'\0');
strcpy(uid1,"scott/tiger_at_Host-B");
/*
Connect to ORACLE.
*/
if (orlon(&lda, &hda, uid1, -1,(text *) 0, -1, 0 ))
{
printf("Could not connect to ORACLE as %s\n",uid1); exit(1);
}
printf("Connected to ORACLE as %s\n", uid1);
/* ************** End - of - code ************************* */
tnsnames.ora on Host-A has an entry for Host-B.
Is there anything else I should be doing(setting up env vars, etc) on the client side, in order to connect to the DB on Host-B? The reason I ask is, that the same script works when executed on Host-B.
I checked the listener/DB on Host-B, both are up and running.
Thanks for your help..
Raj
Received on Tue Nov 19 1996 - 00:00:00 CET