comparison sqlpython.py @ 9:f70cc3be6377

reporting rowcount
author devlinjs@FA7CZA6N1254998.wrightpatterson.afmc.ds.af.mil
date Tue, 18 Dec 2007 10:45:45 -0500
parents cd23cd62de3c
children 2776755a3a7e
comparison
equal deleted inserted replaced
8:8e909570e7de 9:f70cc3be6377
96 do_sqlp = do_sqlplus 96 do_sqlp = do_sqlplus
97 def do_senora(self, arg): 97 def do_senora(self, arg):
98 '''Sends a command to a Senora session (http://senora.sourceforge.net/)''' 98 '''Sends a command to a Senora session (http://senora.sourceforge.net/)'''
99 self.designated_session(arg, pexpecter.SenoraSession) 99 self.designated_session(arg, pexpecter.SenoraSession)
100 do_sen = do_senora 100 do_sen = do_senora
101 101
102 def default(self, arg, do_everywhere = False): 102 def default(self, arg, do_everywhere = False):
103 self.query = finishStatement(arg) 103 self.query = finishStatement(arg).strip().rstrip(';')
104 try: 104 try:
105 self.curs.execute(self.query) 105 self.curs.execute(self.query)
106 print '\nExecuted\n' 106 print '\nExecuted%s\n' % ((self.curs.rowcount > 0) and ' (%d rows)' % self.curs.rowcount or '')
107 if do_everywhere: 107 if do_everywhere:
108 self.fail(arg, do_everywhere = True ) 108 self.fail(arg, do_everywhere = True )
109 except Exception, e: 109 except Exception, e:
110 result = self.fail(arg) 110 result = self.fail(arg)
111 if not result: 111 if not result: