diff options
Diffstat (limited to 'dbutils.py')
| -rw-r--r-- | dbutils.py | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3,8 +3,8 @@ import dbconfig connStr = '%s/%s@%s' % (dbconfig.USER, dbconfig.PASS, dbconfig.SID) -with cx_Oracle.connect(connStr) as conn: - cur = conn.cursor() - cur.execute('SELECT COUNT(*) FROM D_CARRIL_PM_2008_01') - for s in cur.fetchall(): - print s +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()] |
