Changeset 3025


Ignore:
Timestamp:
Sep 19, 2010 10:07:37 PM (11 years ago)
Author:
wehart
Message:

Creating a 'table' option, which creates a query automatically.

Location:
coopr.pyomo/trunk/coopr/pyomo/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/data/db_table.py

    r3012 r3025  
    2020# user=
    2121# password=
     22# table=
    2223
    2324class db_Table(TableData):
     
    5455        #print "\nReading foods:\n"
    5556        tmp = []
     57        if self.options.query is None:
     58            self.options.query = 'SELECT * FROM '+self.options.table
    5659        print "DATA start",self.options.query
    5760        cursor.execute(self.options.query[1:-1])
  • coopr.pyomo/trunk/coopr/pyomo/data/process_data.py

    r3019 r3025  
    521521    options = Options(**cmd[1])
    522522    for key in options:
    523         if not key in ['range','filename','format','using','query','user','password']:
     523        if not key in ['range','filename','format','using','query','table','user','password']:
    524524            raise ValueError, "Unknown import option '%s'" % key
    525525
Note: See TracChangeset for help on using the changeset viewer.