# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1236906655 14400 # Node ID b61e21386383ce227d786046d9cdf9cdabad479b # Parent e4b741d882b7c016080c3fb7e3a063b3853cb229 oops, restore lines of code after sql_format_item diff -r e4b741d882b7 -r b61e21386383 sqlpython/sqlpyPlus.py --- 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]