Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Run a statement. Note that the cursor is *mutable*, and will contain
the results after running.

        def execute_statement(statement, parameters, cursor, db, error_message,
                      exception=Exception):
    """Run a statement. Note that the cursor is *mutable*, and will contain
        the results after running.
    """

    if isinstance(db, SqliteDatabase):
        import sqlite3.dbapi2

        try:
            return cursor.execute(statement, parameters)
        except sqlite3.dbapi2.OperationalError as e:
            printerr(error_message + ": %s", (e,))
        except Exception as e:
            raise exception(e)

    elif isinstance(db, MysqlDatabase):
        import MySQLdb

        try:
            return cursor.execute(statement, parameters)
        except (MySQLdb.OperationalError, MySQLdb.IntegrityError) as e:
            printerr(error_message + ": %s", (e,))
        except Exception as e:
            raise exception(e)
        


src/m/i/MininGit-HEAD/pycvsanaly2/DBDeletionHandler.py   MininGit(Download)
#       Chris Lewis <cflewis@soe.ucsc.edu>
 
from Database import (execute_statement, get_repo_id, statement, RepoNotFound)
from utils import printdbg, printout, printerr
 
        try:
            delete_cursor = self.connection.cursor()
            execute_statement(statement(delete_statement, 
                                        self.db.place_holder),
                              params, delete_cursor,