Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: need help with OCIBindByPos
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