Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get count using OCI?
It's a good idea to declare variables used with OCI using the OCI types
and avoid having casts in your function calls. That way the compiler
will alert you if you are sending the wrong thing. This:
ub1 Count;
/* stuff... */ odefin(&cda, 1, Count, ....); /* more stuff... */
would at least give a warning. Or better yet, not compile.
In article <378DF6AA.6BF856D0@__qmsoft.com>,
Tee Parham <tparham@__qmsoft.com> wrote:
>
> I figured it out-- since this is probably a common mistake not
limited to
> getting counts, but anything via OCI, I'll share:
>
> I kept getting an unhandled exception error when I did the ofetch.
The
> problem was with the 3rd parameter of the odefin() function, [ ub1
*buf ]
> , which is the pointer to the defined variable.
>
> My call looked like this:
>
> long Count;
> odefin(&cda, 1, (ub1*) Count, ....)
>
> when it should be
>
> odefin(&cda, 1, (ub1*) &Count, ....)
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri Jul 16 1999 - 07:53:01 CDT
![]() |
![]() |