Subject Re: [IBO] "order by coalesce" problem
Author Matej Golob
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...> wrote:
> > If I put SQL sentence like
> > "select * from table order by coalesce(field1, field2)"
> > into TIBOQuery, I got error:
> > Dynamic SQL Error SQL error code = -104 Token unknown - line 4, char
> > 30 ASC
> >
> > I tryed same sentence in IBExpert, and works fine.
>
> Show us more please, what does the SQL trace monitor show?
Into query i put:
"select field1 from my_table order by coalesce(field1, field2)",

with SQL monitor I see:

select field1, my_table.RDB$DB_KEY from my_table
ORDER BY coalesce(field1 ASC, field2) ASC

> My guess is the SQL parsing I do is messing it up.
Yes, it looks like that...

Thanks for help and regards.

Matej