summaryrefslogtreecommitdiff
path: root/dbutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'dbutils.py')
-rw-r--r--dbutils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/dbutils.py b/dbutils.py
new file mode 100644
index 0000000..f073548
--- /dev/null
+++ b/dbutils.py
@@ -0,0 +1,10 @@
+import cx_Oracle
+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