aboutsummaryrefslogtreecommitdiffstats
path: root/python/query_runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/query_runner.py')
-rw-r--r--python/query_runner.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/query_runner.py b/python/query_runner.py
new file mode 100644
index 00000000..45595f98
--- /dev/null
+++ b/python/query_runner.py
@@ -0,0 +1,12 @@
+import psycopg2
+conn = psycopg2.connect(database="ET", user="guillaume")
+cursor = conn.cursor()
+
+# cursor.execute("select select a.name,a.issuername,a.loanxid,b.bid from et_collateral a left outer join markit_prices b on a.loanxid=b.loanxid where a.dealname='octagon8'")
+cursor.execute("select a.name, COALESCE(b.bid,c.price) as price, a.currentbalance from et_collateral a left outer join markit_prices b on a.loanxid=b.loanxid left outer join bloomberg_prices c on a.cusip=c.cusip where a.dealname='octagon8'")
+
+for line in cursor:
+ # import pdb;pdb.set_trace()
+ print "\t".join(map(str,line))
+cursor.close()
+conn.close()