Subject Re: [IBO] EditSQL
Author lobolo2000
On second thought, the solution I proposed should work if you use an outer
join instead of the subquery (and without the B prefix!). Not sure if it
works with the subquery.
For the subquery case, use:

UPDATE FAKTUUR_XP1 SET
FAKTUUR_EUR = :JAAR_2001
WHERE
KLANTNR = :CUSTNO AND JAAR = 2001

UPDATE FAKTUUR_XP1 SET
FAKTUUR_EUR = :JAAR_2002
WHERE
KLANTNR = :CUSTNO AND JAAR = 2002

HTH,
Wassim

""lobolo2000"" <lobolo2000@...> wrote in message
news:avjft5$fc4$1@......
> If you had to update one row in FAAKTUR_XP1, then your EditSQL would look
> like:
> UPDATE FAKTUUR_XP1 SET
> FAKTUUR_EUR = :FAKTUUR_EUR
> WHERE
> KLANTNR = :OLD_KLANTNR AND B.JAAR = 2001
>
> But since you have to update 2 rows, call from the EditSQL a stored
> procedure with the required parameters to execute these 2 SQL statements:
>
> UPDATE FAKTUUR_XP1 SET
> FAKTUUR_EUR = :FAKTUUR_EUR
> WHERE
> KLANTNR = :OLD_KLANTNR AND B.JAAR = 2001;
>
> UPDATE FAKTUUR_XP1 SET
> FAKTUUR_EUR = :FAKTUUR_EUR
> WHERE
> KLANTNR = :OLD_KLANTNR AND B.JAAR = 2002;
>
> HTH,
>
> Wassim
>
> ""Nico Callewaert"" <ncw@...> wrote in message
> news:EJEDKPEMKJFPEMJJIOIOIEJJCAAA.ncw@......
> > Hi,
> >
> > I have a query like this :
> >
> > SELECT A.CUSTNO,
> > (SELECT B.FAKTUUR_EUR FROM FAKTUUR_XP1 B WHERE (B.KLANTNR = A.CUSTNO)
> AND
> > (B.JAAR = 2001)) AS JAAR_2001,
> > (SELECT B.FAKTUUR_EUR FROM FAKTUUR_XP1 B WHERE (B.KLANTNR = A.CUSTNO)
> AND
> > (B.JAAR = 2002)) AS JAAR_2002
> > FROM CUST A
> > ORDER BY A.CUSTNO
> >
> > I need some values next to each other in a DBGrid, a customer with
invoice
> > information from year 2001 and 2002, so that's why I needed a query like
> > this. The problem now is, I have to update the fields JAAR_2001 and
> > JAAR_2002. Is this possible ? Becuase they are referred as a alias.
I
> > was thinking of the EditSQL property with a stored proc ?
> >
> > Thanks in advance,
> >
> > Nico Callewaert
> >
> >
> >
> >
> >
>
___________________________________________________________________________
> > 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/
>
>
>