def spcall(qry, param, commit=False): try: dbo = DBconn() cursor = dbo.getcursor() cursor.callproc(qry, param) res = cursor.fetchall() if commit: dbo.dbcommit() return res except: res = [("Error: " + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]),)] return res