Run SQL query and return result

    CLI Example:

    .. code-block:: bash

        salt '*' oracle.run_query my_db "select * from my_table"

def run_query(db, query):
    '''
    Run SQL query and return result

    CLI Example:

    .. code-block:: bash

        salt '*' oracle.run_query my_db "select * from my_table"
    '''
    if db in [x.keys()[0] for x in show_dbs()]:
        conn = _connect(show_dbs(db)[db]['uri'])
    else:
        log.debug('No uri found in pillars - will try to use oratab')
        # if db does not have uri defined in pillars
        # or it's not defined in pillars at all parse oratab file
        conn = _connect(uri=db)
    return conn.cursor().execute(query).fetchall()