Subject | RE: [IBO] Update SQL question |
---|---|
Author | Helen Borrie |
Post date | 2003-03-27T02:28:43Z |
At 01:04 PM 27/03/2003 +1100, you wrote:
the parameter 'LINKTOJOBSCHED' has an alter-ego in the dataset, then you
can use this as is to get automatic assignment of it to the corresponding
parameter in the UpdateSQL statement.
It isn't clear from your statement where you are getting your parameter
values from. If both are dataset columns, then linking the two parameters
to their respective dataset columns via matching parameter names will get
the automatic assignment. If you are assigning the value of a variable to
the value of a non-linked parameter, you have to do this via code, always
(even where there are other columns in the XxxxSQL that *are* name-linked).
Just don't treat parameters as if they were variables!
Helen
>yeh - but IBO won't ba able to automatically assign these two parameterNo. If your statement is actually the EditSQL property of a dataset, and
>values will it?
the parameter 'LINKTOJOBSCHED' has an alter-ego in the dataset, then you
can use this as is to get automatic assignment of it to the corresponding
parameter in the UpdateSQL statement.
It isn't clear from your statement where you are getting your parameter
values from. If both are dataset columns, then linking the two parameters
to their respective dataset columns via matching parameter names will get
the automatic assignment. If you are assigning the value of a variable to
the value of a non-linked parameter, you have to do this via code, always
(even where there are other columns in the XxxxSQL that *are* name-linked).
Just don't treat parameters as if they were variables!
Helen
>-----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/
>
>
>
>
>
>___________________________________________________________________________
>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/