Subject RE: [IBO] Update SQL question
Author Alan McDonald
mine's not the same problem really - I'm trying to rely on IBO's param
setting in TIB_Query's UpdateSQL
no matter - there's lot's of ways to sking this cat... just thought it would
be rather neat to use the same parameter more than once in this instance but
instead of the engine using the parameter value and setting all occurences
of it, it just does the first one.

Alan

-----Original Message-----
From: Paul Vinkenoog [mailto:paul@...]
Sent: Thursday, 27 March 2003 1:00 PM
To: IBObjects@yahoogroups.com
Subject: Re: [IBO] Update SQL question


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



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/