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: OCIBindByPos problem

Re: OCIBindByPos problem

From: stuart coupe <stuart_at_easysoft.com>
Date: Tue, 16 Oct 2001 09:50:31 +0100
Message-ID: <3BCBF4D7.6000604@easysoft.com>


I had a similar sounding problem last week. This what appeared to be happening.
I had no problems when the columns were varchar2 types. When they were char types I had to space pad the bound value.

eg

create table t ( c char(4) ) ;
insert into t values ( 'ab' ) ;

select c from t where t = :1 ;

binding 'ab' returned no rows .
binding 'ab ' returned the row.

Hope this helps.

Cheers,
Stuart.

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 Tue Oct 16 2001 - 03:50:31 CDT

Original text of this message

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