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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get count using OCI?

Re: How to get count using OCI?

From: <dgallardo_at_my-deja.com>
Date: Fri, 16 Jul 1999 12:53:01 GMT
Message-ID: <7mn9v8$eb6$1@nnrp1.deja.com>


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

Original text of this message

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