Subject Re: [IBO] IboQuery add fields problem
Author Carlos Martins
Thanks for your anser, but im trying to migrate from bde to ibo and from firebird 1.5 to firebird 2.5. im my code i have lots of querys with reserved word (sum , count, max min, and so on),. I know that i can solve my problem with the keyword AS, but i was trying an earsier way to do it. is it possible ?. Thanks Carlos




------------------------------
On Tue, Sep 18, 2012 12:02 PM PDT Helen Borrie wrote:

>At 02:38 AM 19/09/2012, jcfmgmr wrote:
>>Hello
>>
>>When i try to add fields from a iboquery (with this sql: select sum(faccod) from tab_fac ) at design time, on the avaible fields box
>>shows the field '"SUM"' ( SUM with double quotes).
>>When i try to use this field i get the message .. field '"SUM"' not found.
>>Note:
>>I only get this error when i connect to a firebird server 2.5 ( Dialect 3; CharSEt WIN1252), If i connect to a firebird server 1.5 ( Dialect 1; CharSEt NONE), evrything works just fine.
>>
>>Could anybody help ??
>
>Various things have happened with "lazy" SQL in Firebird since v.1.5 to disambiguate behaviour. The names of calculated fields specified without identifiers are a case in point. AFAIU, IBO is trying to do the right thing by double-quoting a field that is a reserved word.
>
>Try it with the proper syntax of
>
>select sum(faccod) AS TOTAL from tab_fac
>
>(The keyword AS is optional, the fieldname can be any valid identifier.)
>
>Helen
>