Subject Re: [firebird-support] Re: Could you help me with basic SELECT queries, please?
Author Robert martin
Hi Ann

Iv'e seen this mentioned a few times before and do agree that using
field names is optimal if only just to reduce the amount of data being
returned. However I do struggle to understand you point about '*'
meaning your application has built a knowledge of the number of coloumns
in a table. I would have thought the exact reverse, in a number of
points in our app we purposely use '*' because if the table structure
changes we don't need to change the query, only the code reading values
from it.

Thanks
Rob

> Actually, I'd suggest replacing the first version
> with
>
> select <column list> from ThisTable t
>
> The * is a handy thing in an interactive tool or a throw-away program
> but one of the strengths of the relational model is separation of logical
> and stored formats, leading to the ability to add columns to a table
> and change column types. As soon as your application builds in
> knowledge of the number of columns in a table you've blocked that
> ability... unless you create a layer of views over the tables to preserve
> the old formats, which begins to confuse the naming of things.
>
> Good luck,
>
> Ann
>
>
> ------------------------------------------------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 10.0.1321 / Virus Database: 1500/3572 - Release Date: 04/13/11
>