Subject Re: Change query status from "UnableToEditRow" to editable
Author amoradell
Hello,

I suggest you post it to IBObjects list.

Anyway, it's good practice to use an alias for tablename
when you use several tables or same table many times :

FROM EINKAUFHISTORIE E

select min(e1.effekpreis) as MINI,max(e1.effekpreis) as MAXI,
min(e1.ref0) as
ref0temp from einkaufhistorie e1
where e1.ref0=:MLNK_REF0_0 and e1.effekpreis>0

on mm.ref0temp=e.ref0

Regards

Alexandre

PS : I think also Fb 20 is less tolerant on that (see Release notes)

--- In firebird-support@yahoogroups.com, "G. Nau" <b404_r66@...> wrote:
>
> IBO 4.8.5 on FB 2.0
>
> I'm using this query-SQL:
> SELECT REF
> , DATUM
> , LIEFERANTENNR
> , KURZNAME
> , TEXT
> , EFFEKPREIS
> , EKPREIS
> , AUFSCHLAG
> , FRACHTKOSTEN
> , SONSTKOSTEN
> , RUNDUNG
> , VKPREIS
> , ARTPREISBERECHNUNG
> , EINKAUFMENGE
> , DATUMPREISAEND
> , REF0
> , mini,maxi
> FROM EINKAUFHISTORIE
> left outer join (
> select min(effekpreis) as MINI,max(effekpreis) as MAXI, min(ref0) as
> ref0temp from einkaufhistorie
> where ref0=:MLNK_REF0_0 and effekpreis>0
> and F_ADDDAY(einkaufhistorie.datum,<<MINMAXTAGE>>)>='now'
> ) mm
> on mm.ref0temp=ref0
>
> The mini, maxi fields and the left outer join is just a last
addition to display
> some min and max values.
> Now the update procedures are failing with error "Unable to edit
row". Well,
> that's correct if only the above SQL is looked at.
> BUT the update and insert SQL stays the same (without the mini and maxi
> fields) with:
> Update:
> UPDATE EINKAUFHISTORIE SET
> REF = :REF, /*PK*/
> DATUM = :DATUM,
> LIEFERANTENNR = :LIEFERANTENNR,
> KURZNAME = :KURZNAME,
> TEXT = :TEXT,
> EFFEKPREIS = :EFFEKPREIS,
> EKPREIS = :EKPREIS,
> AUFSCHLAG = :AUFSCHLAG,
> FRACHTKOSTEN = :FRACHTKOSTEN,
> SONSTKOSTEN = :SONSTKOSTEN,
> RUNDUNG = :RUNDUNG,
> VKPREIS = :VKPREIS,
> ARTPREISBERECHNUNG = :ARTPREISBERECHNUNG,
> EINKAUFMENGE = :EINKAUFMENGE,
> DATUMPREISAEND = :DATUMPREISAEND,
> REF0 = :REF0
> WHERE
> REF = :OLD_REF
>
> When I change my SELECT SQL to:
> SELECT REF
> , DATUM
> , LIEFERANTENNR
> , KURZNAME
> , TEXT
> , EFFEKPREIS
> , EKPREIS
> , AUFSCHLAG
> , FRACHTKOSTEN
> , SONSTKOSTEN
> , RUNDUNG
> , VKPREIS
> , ARTPREISBERECHNUNG
> , EINKAUFMENGE
> , DATUMPREISAEND
> , REF0
> , 0 as mini,0 as maxi
> FROM EINKAUFHISTORIE
> then the edit of the rows is allowed again.
>
> Is there a flag to order IBO to accept edit changes to the first
Select SQL
> containg the join clause?
>
> Regards
> Gunther
>