summaryrefslogtreecommitdiff
path: root/dbutils.py
blob: 31d56ab8bccb40f37bc1b053a133b9f0aa1d05ef (plain)
1
2
3
4
5
6
7
8
9
10
11
import cx_Oracle
import dbconfig

CONN_STR = '%s/%s@%s' % (dbconfig.USER, dbconfig.PASS, dbconfig.SID)

def get_tables():
    with cx_Oracle.connect(CONN_STR) as conn:
        cur = conn.cursor()
        cur.execute('SELECT owner, table_name FROM all_tables')
        return [table for owner, table in cur.fetchall()]