comparison sqlpython.py @ 123:898ed97bec38

fixed bug in setting parameters
author catherine@Elli.myhome.westell.com
date Wed, 30 Jul 2008 11:06:10 -0400
parents e11bbeb3f34c
children 2b42b7bc29cb
comparison
equal deleted inserted replaced
122:61e2a824b66b 123:898ed97bec38
23 self.prompt = 'SQL.No_Connection> ' 23 self.prompt = 'SQL.No_Connection> '
24 self.maxfetch = 1000 24 self.maxfetch = 1000
25 self.failoverSessions = [] 25 self.failoverSessions = []
26 self.terminator = ';' 26 self.terminator = ';'
27 self.timeout = 30 27 self.timeout = 30
28 self.commit_on_exit = True
28 29
29 connection_modes = {re.compile(' AS SYSDBA', re.IGNORECASE): cx_Oracle.SYSDBA, 30 connection_modes = {re.compile(' AS SYSDBA', re.IGNORECASE): cx_Oracle.SYSDBA,
30 re.compile(' AS SYSOPER', re.IGNORECASE): cx_Oracle.SYSOPER} 31 re.compile(' AS SYSOPER', re.IGNORECASE): cx_Oracle.SYSOPER}
31 def do_connect(self, arg): 32 def do_connect(self, arg):
32 '''Opens the DB connection''' 33 '''Opens the DB connection'''
139 140
140 def do_commit(self, arg): 141 def do_commit(self, arg):
141 self.default('commit %s;' % (arg), do_everywhere=True) 142 self.default('commit %s;' % (arg), do_everywhere=True)
142 def do_rollback(self, arg): 143 def do_rollback(self, arg):
143 self.default('rollback %s;' % (arg), do_everywhere=True) 144 self.default('rollback %s;' % (arg), do_everywhere=True)
144 145 def do_quit(self, arg):
145 # shortcuts 146 if self.commit_on_exit:
146 do_exit = cmd2.Cmd.do_quit 147 self.default('commit;')
148 cmd2.Cmd.do_quit()
149 do_exit = do_quit
150 do_q = do_quit
147 151
148 def pmatrix(rows,desc,maxlen=30): 152 def pmatrix(rows,desc,maxlen=30):
149 '''prints a matrix, used by sqlpython to print queries' result sets''' 153 '''prints a matrix, used by sqlpython to print queries' result sets'''
150 names = [] 154 names = []
151 maxen = [] 155 maxen = []