Mercurial > sqlpython
changeset 254:b61e21386383
oops, restore lines of code after sql_format_item
author | catherine@Elli.myhome.westell.com |
---|---|
date | Thu, 12 Mar 2009 21:10:55 -0400 |
parents | e4b741d882b7 |
children | 39ecc4b65b11 |
files | sqlpython/sqlpyPlus.py |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py Thu Mar 12 21:06:13 2009 -0400 +++ b/sqlpython/sqlpyPlus.py Thu Mar 12 21:10:55 2009 -0400 @@ -424,6 +424,12 @@ for (scchar, scto) in self.shortcuts.items(): print '%s: %s' % (scchar, scto) + tableNameFinder = re.compile(r'from\s+([\w$#_"]+)', re.IGNORECASE | re.MULTILINE | re.DOTALL) + inputStatementFormatters = { + cx_Oracle.STRING: "'%s'", + cx_Oracle.DATETIME: "TO_DATE('%s', 'YYYY-MM-DD HH24:MI:SS')"} + inputStatementFormatters[cx_Oracle.CLOB] = inputStatementFormatters[cx_Oracle.STRING] + inputStatementFormatters[cx_Oracle.TIMESTAMP] = inputStatementFormatters[cx_Oracle.DATETIME] def output(self, outformat, rowlimit): self.tblname = self.tableNameFinder.search(self.curs.statement).group(1) self.colnames = [d[0] for d in self.curs.description]