Subject RE: [IBO] Update SQL question
Author Alan McDonald
yeh - but IBO won't ba able to automatically assign these two parameter
values will it?

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Thursday, 27 March 2003 12:55 PM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Update SQL question


At 12:24 PM 27/03/2003 +1100, you wrote:
>I juggled the sequence around.. I try to use it 3 times.. no matter what
the
>sequence, I only get one use out of it..
>I imagine that the parameter value is set only once in IBO..
>Is here any way to set the other ones?

Alan,
I think your problem here is in the SQL: you are trying to get two values
from a single subquery cursor. Subqueries need to be "self-contained" -
so, even though both of these values come from the "same" table, you have
to provide two cursors so that the query sees them as two sets.

You need a parameter for *each* - a parameter is an object which has a
value, it is not (of itself) a value.

So the statement really ought to be:

UPDATE TBLBSLIST SET
BSREQIND = :BSREQIND, /*PK*/
LINKTOPROJ = (SELECT a.LINKTOPROJ FROM TBLJOBSCHEDULE a
WHERE
a.JOBIND=:LINKTOJOBSCHED1),
LINKTOWO = (SELECT b.LINKTOBSAWWO FROM TBLJOBSCHEDULE b WHERE
b.JOBIND=:LINKTOJOBSCHED2),
BSNO = :BSNO,
LINKTOSLAB = :LINKTOSLAB,
etc

Helen




___________________________________________________________________________
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/