From: brian z. <bz...@us...> - 2001-12-29 07:17:45
|
Update of /cvsroot/jython/jython/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2705 Modified Files: dbexts.py Log Message: added callproc(), updatecount and rowid Index: dbexts.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/dbexts.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbexts.py 2001/12/07 04:03:51 1.2 --- dbexts.py 2001/12/29 07:17:42 1.3 *************** *** 78,82 **** # Check row entry lengths output = [] ! headers = map(string.upper, list(headers)) collen = map(len,headers) output.append(headers) --- 78,82 ---- # Check row entry lengths output = [] ! headers = map(string.upper, list(map(lambda x: x or "", headers))) collen = map(len,headers) output.append(headers) *************** *** 180,183 **** --- 180,185 ---- self.formatter = formatter self.out = out + self.rowid = None + self.updatecount = None if not jndiname: *************** *** 265,268 **** --- 267,272 ---- if f: self.results = choose(self.results is None, [], self.results) + f s = cursor.nextset() + if hasattr(cursor, "rowid"): self.rowid = cursor.rowid + if hasattr(cursor, "updatecount"): self.updatecount = cursor.updatecount if self.autocommit or cursor is None: self.db.commit() if cursor: cursor.close() *************** *** 316,319 **** --- 320,332 ---- self.__execute__(sql, params, bindings, maxrows=maxrows) return (self.headers, self.results) + + def callproc(self, procname, params=None, bindings=None, maxrows=None): + """ execute a stored procedure """ + cur = self.begin() + try: + cur.callproc(procname, params=params, bindings=bindings, maxrows=maxrows) + finally: + self.commit(cur) + self.display() def pk(self, table, owner=None, schema=None): |