Changeset 3292

Show
Ignore:
Timestamp:
01/14/08 00:54:44 (16 years ago)
Author:
jerome
Message:

Removed the LIMIT SQL keyword to accomodate DB2 which apparently lacks it.
TODO : Only one instance of LIMIT remains in retrieveHistory().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/sql.py

    r3291 r3292  
    404404    def getPrinterLastJobFromBackend(self, printer) :         
    405405        """Extracts a printer's last job information.""" 
    406         result = self.doSearch("SELECT jobhistory.id, jobid, userid, username, pagecounter, jobsize, jobprice, filename, title, copies, options, hostname, jobdate, md5sum, pages, billingcode, precomputedjobsize, precomputedjobprice FROM jobhistory, users WHERE printerid=%s AND userid=users.id ORDER BY jobdate DESC LIMIT 1" % self.doQuote(printer.ident)) 
     406        result = self.doSearch("SELECT jobhistory.id, jobid, userid, username, pagecounter, jobsize, jobprice, filename, title, copies, options, hostname, jobdate, md5sum, pages, billingcode, precomputedjobsize, precomputedjobprice FROM jobhistory, users WHERE userid=users.id AND jobhistory.id IN (SELECT max(id) FROM jobhistory WHERE printerid=%s)" % self.doQuote(printer.ident)) 
    407407        if result : 
    408408            return self.storageLastJobFromRecord(printer, result[0])