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

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

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