Subject RE: [IBO] Error with aliases when refreshing rows after a delete from a query
Author Jason Wharton
Woody and Trond,

Woody made an excellent point here.

Does it work correctly when the alias is applied to the *?

On Firebird 2 I get the alias names from the server and if you do not apply
the alias to the * then it seems reasonable that the server wouldn't have
them applied.

I'm curious to know if you watch the SQL trace when preparing your statement
if there are warning messages? I want to get IB_SQL to where it will
display all warning messages, but I have not finished it up yet.

This is a case where I would bet Firebird issues warnings.

Jason

> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Woody
> Sent: Wednesday, November 29, 2006 11:19 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Error with aliases when refreshing rows after a
> delete from a query
>
>
> From: "trondmorken" <trond@...>
> > Hello, I'm using beta 8a of ibo4.7
> >
> > I have a query with this sql :
> > SELECT * FROM Rate R
> >
> > which works fine, but after deleting a row with this query ibo
> > tries to refresh the row and generates a sql statemen of
> >
> > SELECT * FROM Rate R WHERE RATE.Id = ?
> >
> > which fails with firebird 2, Rate.id is unknown
> >
> > Correct generation of statement should bee
> >
> > SELECT * FROM Rate R WHERE R.Id = ?
>
> Although there are "bugs" being worked out for FB 2, you
> should start be
> creating correct SQL statements.
>
> Select R.* from Rate R
>
> If you assign an alias to a table, then you should use that
> alias in all
> field selections. We won't get into the argument about not
> using "*" at all
> in a query instead of listing each field name individually.
> That's a whole
> other discussion. :)
>
> Woody (TMW)