Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> weird OCI error at logon.

weird OCI error at logon.

From: Bjorn Borud <borud_at_gaurdian.no>
Date: 1997/05/25
Message-ID: <jkwraevpehc.fsf@istind.itea.unit.no>#1/1

I've been writing a simple OCI application that is supposed to connect to a database and run an anonymous PL/SQL block that calls a stored function.

after having run into several problems with error messages not reporting the actual problem I am doubtful of the correctness of the error message I am stuck with now.

the following code gives me problems on a 7.3 server under HP-UX:

  if (olog(&lda, (ub1 *) hda, userpass, -1, (text *) 0, -1,

           (text *) 0, -1, OCI_LM_DEF)) {
	return(1);

  }

userpass is a pointer to a null-terminated string containing the username, password and host as used with sqlplus (username/password_at_database). the environment has ORACLE_BASE, ORACLE_HOME and ORACLE_SID set properly. hda size is 256 (should be correct for HP-UX?) and initially filled with null-bytes.

the error message I get is the following (as obtained by oerhms):

  ORA-12504: TNS:listener was not given the SID in CONNECT_DATA

using oerr to elaborate on that I got the following:

  12504, 00000, "TNS:listener was not given the SID in CONNECT_DATA"
// *Cause: The SID was missing from the CONNECT_DATA.
// *Action: Check that the connect descriptor corresponding to the service
  // name in TNSNAMES.ORA has an SID component in the CONNECT_DATA.  

now sqlplus works fine on the machine and the TNSNAMES.ORA file looks fine to me, whichs makes me wonder if this is the actual error. given that none of the previous errors OCI gave me were even near reporting the actual problem I suspect that I shouldn't trust the above error message either.

I would be terribly grateful if anyone could shed some light on my problem. if you wish to view the complete source for the program please email me and I'll send it to you.

-Bjørn

-- 
 Bjørn Borud <borud_at_pvv.org>      | "The Net interprets censorship 
 <URL:http://www.pvv.org/~borud/> | as damage and routes around it."
 UNIX person, one of "them"       |         - John Gilmore
Received on Sun May 25 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US