
7 Oct
2006
7 Oct
'06
6:23 p.m.
Nicola Musatti wrote:
Peter Dimov wrote:
Nicola Musatti wrote:
On the other hand if I'm using a dynamic representation that only relies on a limited subset of the fields involved in the query I'd use '*' so as to limit the conditions that could break my code. In similar cases I wouldn't rely on field order but rather on matching by name.
Why not simply select the limited subset on which you rely?
You're right. Actually the only case where it's meaningful to use 'select *' is when you don't know which columns you're looking for or you don't care. That is, you're either exploring the data or writing a context independent tool.
Even so, it is better to extract the schema first, to guard against selecting large BLOBs.