Subject Re: [firebird-support] Substraction of 2 selections
Author Milan Babuskov
rpoulin wrote:
> Thanks again \\
> Milan,
> Adding the given expression to my table , ie :
>
> ALTER TABLE DETAIL_KIT
> ADD DELTAPRIX2 COMPUTED BY (select d1.PRIX_MARGE_DETAIL -
> d2.PRIX_MARGE_DETAIL from DETAIL_KIT d1 left join DETAIL_KIT d2 on
> d1.no_ordre = d2.no_ordre AND d2.PRINCIPAL ='N' where d1.PRINCIPAL ='O'
> order by d1.NO_ORDRE)
>
> i get the folowing error (i am using EMS Interbase/Firebird Manager)
> fmCompile.quCompile: Invalid token. Dynamic SQL Error. SQL error code =
> -104.
> Token unknown - line 2, char 27. select.
> ----
> 'Select' is not rekongnise in the computed field expression. !!!!!
> Do i need to create a function somwhere ?

Yes, you need to either create view or stored procedure for this.

--
Milan Babuskov
http://fbexport.sourceforge.net