Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCI array of strings bind
You forgot to BindArrayOfStruct(6,0,0,0) after your BindByPos
The 'ALen' parameter lets you specify the Actual LENgth of your parameter. The array itself must have a fixed 'skip size', as specified by BindArrayOfStruct.
In short, you do not need to pad spaces, but use the Alen parameter.
JM
Simeon Bailey wrote in message <3700445F.F435B475_at_astracon.com.au>...
>Hi,
> I'm attempting to bind an array of strings of variable length.
>
>text *textval = "Entry1Entry2"
>ub2 alen[2];
>alen[0] = 6;
>alen[1] = 6;
>
>status = OCIBindByPos (stmtp, &bindpp, errpp, 1, textval, 6,
> SQL_CHR, inds, alen, 0, 0, 0, OCI_DEFAULT);
>
>This works fine, however when I try to insert two strings of different
>lengths things go awry.
>
>Is it possible bind an array of variable length strings, or do they have
>to fixed length padded with spaces?
>
>Thanks S.
>
>
Received on Tue Mar 30 1999 - 09:28:12 CST