Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCIBindByPos problem
Hi,
use strlen(uid) +1 instead of sizeof(uid) in the call to OCIBindByPos
Kai
Jeff Chan wrote:
> Hello all,
>
> When I try to bind a character string to the SQL statement, but it always
> finds no data. Would anyone help me?
>
> char *txtstmt = "SELECT USERNAME FROM TABLEA WHERE FUSERID = :1";
> char *uid = "ABC";
> checkerr(ctxp->errhp, OCIBindByPos(stmtp, &bnd1p, ctxp->errhp, 1,
> uid, sizeof(uid),
> SQLT_CHR, (dvoid *) 0, (ub2 *)0,
> (ub2 *)0, (ub4) 0, (ub4 *)0, OCI_DEFAULT));
>
> Thank you very much.
> Jeff.
>
>
>
Received on Thu Oct 18 2001 - 10:34:52 CDT
![]() |
![]() |