On Thu, Oct 29, 2009 at 2:59 PM, John Crenshaw <johncrens...@priacta.com> wrote: >> If the schema changes, a listing of every column can be >> invalidated, but the asterisk cannot. > > This is only partly true. At some point, the code is going to need to > grab the individual fields, and that is the point where the asterisk > fails to serve you well.
Not really. Consider the following Perl code my $sth = $dbh->prepare("SELECT * FROM table"); $sth->execute; while (my $row = $sth->fetchrow_arrayref) { print join ", ", @$row, "\n"; } Nevertheless, both you and Beau make important and valid points, the most important one being, "nothing is written in stone... it all depends." Although, I do believe that "SELECT * FROM" is bad habit, and can lead to error prone code that may become difficult to troubleshoot. > If new fields are added to the schema, but > those fields are never used, you sacrifice performance. On the other > hand, if fields are added to the schema and you need to use them, you > still have to modify the code to retrieve and use the column. Adding the > new fields to the query at the same time isn't a big deal. > > John > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= Sent from Madison, WI, United States _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users