DBI Commentary
Aahz Maruch
aahz at netcom.com
Fri Jan 21 10:47:09 EST 2000
In article <1263695833-12432931 at hypernet.com>,
Gordon McMillan <gmcm at hypernet.com> wrote:
>Timothy Grant writes:
>>
>> Aahz made the very valid point that specifying columns in your query
>> *guarantees* tuple return order. I had not fully appreciated that, and I
>> have put that into use in a number of places. However, I have to agree
>> with Lance when he says that "SELECT * FROM table" is not as often a bad
>> thing as Aahz claimed.
>
>That was me, not Aahz.
Actually, it was me, too. Timothy made the boo-boo of cc'ing me in
e-mail with no indicator, so he probably saw my response first. He
later responded to that e-mail publicly.
>I've used the trick myself - but it was for building HTML tables
>to display the results from an ad-hoc query built from an HTML
>form. I personally would never use "*" if I new what columns I
>needed.
Yeah; as I told Timothy, if managing the fields is a problem, create a
list and use string.join() to build the SQL string. It's easy enough to
extend that to dict-based access, which you can use to build your own
SQL wrapper library/class.
--
--- Aahz (@netcom.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6
Have a *HAPPY* day!!!!!!!!!!
More information about the Python-list
mailing list