changeset 117:dfb71885dd41

everything seems working
author catherine@Elli.myhome.westell.com
date Fri, 04 Jul 2008 18:54:26 -0400
parents 6e346ae994b9
children 0776ceacfc79
files sqlpyPlus.py sqlpython.py
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpyPlus.py	Fri Jul 04 14:54:01 2008 -0400
+++ b/sqlpyPlus.py	Fri Jul 04 18:54:26 2008 -0400
@@ -508,8 +508,8 @@
     legalOracle = re.compile('[a-zA-Z_$#]')
 
     rowlimitPattern = pyparsing.Word(pyparsing.nums)('rowlimit')
-    terminators = pyparsing.oneOf('; \\s \\S \\c \\C \\t \\x \\h \n/\n')('terminator') + \
-                  pyparsing.Optional(rowlimitPattern)
+    terminatorPattern = pyparsing.oneOf('; \\s \\S \\c \\C \\t \\x \\h \n/\n')('terminator') + \
+                        pyparsing.Optional(rowlimitPattern)
     def do_select(self, arg, bindVarsIn=None, override_terminator=None):
         """Fetch rows from a table.
 
@@ -522,7 +522,7 @@
         """
         bindVarsIn = bindVarsIn or {}
         statement = self.parsed('select ' + arg)
-        self.query = statement.statement
+        self.query = statement.unterminated
         if override_terminator:
             statement['terminator'] = override_terminator
         statement['rowlimit'] = int(statement.rowlimit or 0)
@@ -533,7 +533,7 @@
             self.desc = self.curs.description
             self.rc = self.curs.rowcount
             if self.rc > 0:
-                self.stdout.write('\n%s\n' % (self.output(statement.terminator, rowlimit)))
+                self.stdout.write('\n%s\n' % (self.output(statement.terminator, statement.rowlimit)))
             if self.rc == 0:
                 print '\nNo rows Selected.\n'
             elif self.rc == 1: 
--- a/sqlpython.py	Fri Jul 04 14:54:01 2008 -0400
+++ b/sqlpython.py	Fri Jul 04 18:54:26 2008 -0400
@@ -124,7 +124,8 @@
     do_sen = do_senora       
 
     def default(self, arg, do_everywhere = False):
-        self.query = self.finishStatement(arg).strip().rstrip(';')
+        statement = self.parsed(arg)
+        self.query = statement.unterminated
         try:
             self.varsUsed = sqlpyPlus.findBinds(self.query, self.binds, givenBindVars={})
             self.curs.execute(self.query, self.varsUsed)