Home » Developer & Programmer » Precompilers, OCI & OCCI » OCIEnvcreate returns -1 (Oracle 11g)
OCIEnvcreate returns -1 [message #529684] Wed, 02 November 2011 09:00
any01free
Messages: 1
Registered: November 2011
Junior Member
Hello All,

I have the following snippet and i Get -1 for the return value of OCIEnvCreate and when I do OCIErrorGet in mycheckerror(), I don't get any error message but the errorcode is 0.

------------------------
if (dlsym(oci.lib, "OCIEnvCreate"))
{
retVal = OCIEnvCreate(
(OCIEnv **) &oci.envhp,
OCI_DEFAULT,
NULL,
NULL,
NULL,
NULL,
0,
NULL);
if (retVal != OCI_SUCCESS)
{
mycheckerr(oci.envhp, retVal);
retVal = -1;
}
}
---------------------
void mycheckerr(OCIEnv* err, sword status)
{
text errbuf[2048];
sb4 errcode;

switch (status) {
case OCI_SUCCESS:
break;

case OCI_ERROR:
OCIErrorGet ( (void *) err, (ub4) 1, (text *) NULL, &errcode,
errbuf, (ub4) sizeof(errbuf), (ub4) OCI_HTYPE_ERROR);
printf(" error buf = %s", errbuf);
printf(" error code =%d",errcode);
break;
}
----------------

Please help.

Thanks.
Previous Topic: pro*c Error "Invalid initialization"
Next Topic: reconnect proc if disconnect
Goto Forum:
  


Current Time: Fri Sep 19 11:25:57 CDT 2014

Total time taken to generate the page: 0.06526 seconds