Subject Re: [IBO] Update SQL question
Author Paul Vinkenoog
Hi Alan,

> I have an update statement which is trying to do the following
>
> UPDATE TBLBSLIST SET
> BSREQIND = :BSREQIND, /*PK*/
> LINKTOPROJ = (SELECT LINKTOPROJ FROM TBLJOBSCHEDULE WHERE
> TBLJOBSCHEDULE.JOBIND=:LINKTOJOBSCHED),
> LINKTOWO = (SELECT LINKTOBSAWWO FROM TBLJOBSCHEDULE WHERE
> TBLJOBSCHEDULE.JOBIND=:LINKTOJOBSCHED),
> BSNO = :BSNO,
> LINKTOSLAB = :LINKTOSLAB,
> etc
>
> the result is that the first LINTOPROJ value is set correctly, but
> it apears as though the second use of the parameter :LINKTOJOBSCHED
> is NULL. Is this supposed to happen, i.e. a parameter is cleared to
> null after it's first use? Is this IBO or the engine?

A couple of hours ago someone reported a similar problem, only in his
case it was a SELECT statement where he used the same param twice
(thread: "TIBOQuery bug?"). Problem disappeared when he changed to two
params (which he fed the same value).

Helen then replied:

> Parameters and parameter values are not the same thing. A parameter
> is an object associated with a database column. The token
> ":paramname" is a reference to the parameter, not its value. You
> can apply the same VALUE to two different parameters, but you can't
> apply the same parameter to two different columns.

Could it be you hit the same snag? Although you do use the param to
compare it to the _same_ column twice.


Greetings,
Paul Vinkenoog