changeset 197:3af1615e6ea8

default fix
author catherine@dellzilla
date Mon, 01 Dec 2008 16:19:44 -0500
parents 7940955920a8
children b2d8bf5f89db
files sqlpython/sqlpython.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpython.py	Mon Dec 01 13:43:40 2008 -0500
+++ b/sqlpython/sqlpython.py	Mon Dec 01 16:19:44 2008 -0500
@@ -94,17 +94,19 @@
     terminatorSearchString = '|'.join('\\' + d.split()[0] for d in do_terminators.__doc__.splitlines())
         
     def default(self, arg):
-        self.varsUsed = sqlpyPlus.findBinds(arg, self.binds, givenBindVars={})
-        self.curs.execute(arg, self.varsUsed)            
+        stmt = '%s %s' % (arg.parsed.command, arg.parsed.args)
+        self.varsUsed = sqlpyPlus.findBinds(stmt, self.binds, givenBindVars={})
+        self.curs.execute(stmt, self.varsUsed)            
         print '\nExecuted%s\n' % ((self.curs.rowcount > 0) and ' (%d rows)' % self.curs.rowcount or '')
-            
+        
+    '''
     def do_commit(self, arg):
-        self.default('commit %s;' % (arg))
+        self.default('commit %s' % (arg))
     def do_rollback(self, arg):
-        self.default('rollback %s;' % (arg))        
+        self.default('rollback %s;' % (arg))        '''
     def do_quit(self, arg):
         if self.commit_on_exit and hasattr(self, 'curs'):
-            self.default('commit')
+            self.default(self.parsed('commit'))
         return cmd2.Cmd.do_quit(self, None)
     do_exit = do_quit
     do_q = do_quit