[Tutor] database question

Alan Gauld alan.gauld at btinternet.com
Sat Oct 28 01:14:39 CEST 2006

> For example
> with "SELECT * FROM a", I use this code
> ... to know how many columns are in the result,

As a general rule its better to avoid "Select * From" in production 
If the table definition changes the data returned can change in 
ways and break your application. In addition you can wind up sucking
up an awful lot of unnecessary data (think bandwidth and server 
Its much safer to  explicitly list all of the columns you want to pull 
if at all possible.

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list