Execute a stored procedure. Returns the number of affected rows.

def execute_proc(procname, args=()):
    """
    Execute a stored procedure. Returns the number of affected rows.
    """
    ctx = Context.current()
    with ctx.mdr:
        cursor = ctx.execute_proc(procname, args)
        row_count = cursor.rowcount
        _safe_close(cursor)
    return row_count