Re: OCI errors and ORA-00000

From: <petehanlon_at_my-deja.com>
Date: Tue, 07 Dec 1999 21:20:54 GMT
Message-ID: <82jtng$t2v$1_at_nnrp1.deja.com>


I assume SQL_ERROR is a macro that expands to cda.rc. If this is the case, the call to oclose after the oparse fails is resetting the OCI return code.

You can easily fix this by placing the oracle return code into a temporary variable directly after the oparse command and returning the value of the temp variable not cda.rc.

Hope this helps

Pete.

In article <38428C43.2A31E2CE_at_mindless.com>,   Sundar Raman <cybertoast_at_mindless.com> wrote:
> A bit more information - the return message to
the below code is:
> (Database: sqluser) oparse failed (ORA-00000:
normal, successful completion)
>
> Don't know if this helps, but just thought I'd
add it in case.
>
> Thanks.
>
> Sundar Raman wrote:
>
> > I've got a problem that is cofusing me quite a
bit. My program uses OCI
> > 7.3 calls, such as oopen(), oparse(),
obndrv(), etc. I've got a
> > situation where my application crashes due to
it thinking that an error
> > has occurred in code like below:
> >
> > if (oparse (&(cursor.cda), sqluser, (sb4)
- 1, DEFER_PARSE,
> > (ub4)VERSION_7))
> > {
> > text msg[600];
> > sword rv;
> > rv = oerhms(cursor.lda, cursor.cda.rc,
msg, 600);
> > printf ("Database: sqluser "
> > "oparse failed (%.*s)",
FunctionName, WorkerID, rv, msg);
> >
> > if (oclose(&cursor.cda))
> > {
> > printf ("WARNING: %s: (WID %ld):
(Database): "
> > "oclose1 failed",
> > FunctionName, WorkerID);
> > }
> > return(SQL_ERROR);
> > }
> >
> > Problem is that the message code is ORA-00000
which should mean that no
> > error happened. How is it that oparse()
thinks that the call failed?
> > Do I have to now do a check for the return
status also, just to check to
> > see if the call failed and if the return code
is a success?
> >
> > Why is this the case?
> >
> > Thanks a lot for your help.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Dec 07 1999 - 22:20:54 CET

Original text of this message