Yes, the data type is the 'money'. I have change the table data type from money to numeric(10,2).It seems every thing is OK now.
Anyway, thanks for you help! 2009/3/25 D'Arcy J.M. Cain <[email protected]>: > On Wed, 25 Mar 2009 18:34:45 +0800 > OnMyWay <[email protected]> wrote: >> Sorry for describe so clear, the 0.0 must be a money type but the >> value is 0.0, is that pygresql doesn't support money type? >> >> Here is my code >> ==cut== >> class stock_anly: >> def __init__(self): >> self.dbName = 'redhill' >> self.ServerName = 'xxx_lnx' >> self.User = 'xx' >> self.db = >> pg.DB(dbname=self.dbName,host=self.ServerName,user=self.User) >> def getStockShift(self): >> db = self.db >> sqlcmd = 'select * from xx_table' >> dicShift = db.query(sqlcmd).getresult() >> print dicShift >> ==cut== >> Here is the result: >> ==cut== >> [('600997', '2009-03-13', 0.0, 0.0, 0.0, 0.0, 0.0, 7445824, 0.0), > > Can you do "\d xx_table" in psql and show us the table definition > please. I assume one or more of these fields is supposed to be money > but we can't see your database unless you show us. > > Did you try my script (with any local changes to make it run) yet? > What did it show you? > > -- > D'Arcy J.M. Cain > PyGreSQL Development Group > http://www.PyGreSQL.org > -- 提供定制Clearcase脚本服务。 _______________________________________________ PyGreSQL mailing list [email protected] http://mailman.vex.net/mailman/listinfo/pygresql
