@depends('cx_Oracle', fallback_function=_cx_oracle_req)
def run_query(db, query):
 log.debug('run query on {0}: {1}'.format(db, query))
 conn = _connect(show_dbs(db)[db]['uri'])
 return conn.cursor().execute(query).fetchall()

@ depends ( 'cx_Oracle' , fallback_function = _cx_oracle_req ) def run_query ( db , query ) : log . debug ( 'run query on {0}: {1}' . format ( db , query ) ) conn = _connect ( show_dbs ( db ) [ db ] [ 'uri' ] ) return conn . cursor ( ) . execute ( query ) . fetchall ( )
run sql query and return result cli example: .