summaryrefslogtreecommitdiff
path: root/dbutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'dbutils.py')
-rw-r--r--dbutils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/dbutils.py b/dbutils.py
index f073548..2dd8e66 100644
--- a/dbutils.py
+++ b/dbutils.py
@@ -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()]