Subject Re: [IBO] Another parameter example
Author Paul Vinkenoog
Hi Paul,

> Heres another example of parameter values getting in a twist

> select * from CUSTOMER where
> ...
> (('?'=? /* OC */ )or(TERMS=? /* OC */ )) and
> (('?'=? /* VC */ )or(VAT_CLASS=? /* VC */ )) and
> ...

> EXECUTE STATEMENT
> TR_HANDLE = 21446788
> STMT_HANDLE = 21455072
> PARAMS = [ Version 1 SQLd 22 SQLn 22
> [CO] = 'A'
> ...
> [OC] = '?'
> [OC] = <NULL>
> [VC] = 'H'
> [VC] = <NULL>
> ...

> For some reason the second occurence of OC and VC are NULL whereas
> other seamingly similar parameters are OK.

If you use the same parameter more than once in your SQL, chances are
that two different parameters are created and passed to the server,
the second one uninitialized (since you don't know it's there, you
won't set it).

You can avoid this, but I don't remember how. However, this has been
discussed several times on the list during the last half year or so,
so doing a search could help you here. (Or a reply from someone who
*does* remember ;-))


Greetings,
Paul Vinkenoog