REPOST: dtuple and sql functions

tweek tweek154 at yahoo.com
Wed Dec 26 14:30:33 EST 2001


i am dealing with converting the date format from a MySQL database and
i'd prefer to use the built in sql function than convert it using
python.  here is what im trying to accomplish:


flist = ["AssignedTo", "DATE_FORMAT(DueDate, '%m/%e/%Y')"]
descr = dtuple.TupleDescriptor([[n] for n in flist])

sql = """SELECT %s FROM joblog""" % ", ".join(flist)
c.execute(sql)
temp = c.fetchall()


now unfortunately the field name is now called:
temp.DATE_FORMAT(DueDate, '%m/%e/%Y')

which should be invalid anyways.  what i want is to use it as
temp.DueDate


Tweek

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool1-nwblwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!enews.sgi.com!news-xfer.nuri.net!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: tweek154 at yahoo.com (tweek)
Newsgroups: comp.lang.python
Subject: cmsg cancel <ac5c87bb.0112261130.5422f67e at posting.google.com>
Control: cancel <ac5c87bb.0112261130.5422f67e at posting.google.com>
Date: Mon, 31 Dec 2001 03:56:06 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.ac5c87bb.0112261130.5422f67e at posting.google.com>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009776125 27193 211.57.49.2 (31 Dec 2001 05:22:05 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:22:05 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list