Gadfly question

Bjorn Pettersen BPettersen at NAREX.com
Tue May 20 21:46:01 EDT 2003


> From: Gerhard Häring [mailto:gh at ghaering.de] 
> 
> matthew wrote:
> > Hi,
> > 
> > I've installed and been playing around quickly with Gadfly. 
> [...] [SELECT * FROM ...]
> > ie: Table defined as Name,Phone, FAX, Nickname
> > output tuple gives fields as Phone, FAX, Nickname, Name
> > Shouldn't they be identical?
> 
> Maybe. The lesson you learnt today is to not use SELECT * ;-)
> 
> Your SQL will be more maintanable without SELECT *, anyway. 
> It's better to always name the columns you request 
> explicitly. The reason why I always recommend this is 
> that if you ever insert an additional column, your existing 
> code will continue to work. That certain  databases return 
> the columns in a more or less random order is news to me, but only 
> reinforces my belief that SELECT * is evil.

Nah, just not very useful for programming (fine for e.g. exploration). The SQL'92 standard defines column order in SELECT * as being implementation defined (however even databases that reoder columns for efficiency usually try to display them in "correct" order).

-- bjorn





More information about the Python-list mailing list