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 -> Re: need help with OCIBindByPos

Re: need help with OCIBindByPos

From: Frederico Fonseca <real-email-in-msg-spam_at_email.com>
Date: Wed, 10 Sep 2003 19:28:41 +0100
Message-ID: <c9rulvsq4ie61f7ifjfrqt3b7dkg7qr5fg@4ax.com>


On Wed, 10 Sep 2003 18:35:50 +0200, "Dirk Michael" <michael.dirk_at_web.de> wrote:

>Hi
>
>i have a little problem with OCIBindByPos. i have an prepared statement like
>this:
>INSERT INTO test VALUES (:p1)
>where :p1 should be an integer value.
>
>Now i try to bind an integer value to p1:
>
>int value = 99;
>OCIBindByPos(m_ociStmt,
> &bindpp,
> m_ociError,
> 1,
> (dvoid*)&value,
> (sb4)sizeof(value),
> SQL_INT,
> (dvoid*)0,
> (ub2*)0,
> (ub2*)0,
> (sb4)0,
> (ub4*)0,
> OCI_DEFAULT)
>This works fine and when i execute the statement, no error occures. But if I
>look in the table then he sets this value not 99 but to 4125150 or so.
>Where is my mistake? Thanks!

Try replacing

   (dvoid*)&value,
with

   (dvoid*)value,

Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com Received on Wed Sep 10 2003 - 13:28:41 CDT

Original text of this message

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