diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/cusip_numbers.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/python/cusip_numbers.py b/python/cusip_numbers.py new file mode 100644 index 00000000..72e9f6f3 --- /dev/null +++ b/python/cusip_numbers.py @@ -0,0 +1,26 @@ +import psycopg2
+import os
+import os.path
+import pdb
+
+if os.name =='nt':
+ root = "//WDsentinel/share/CorpCDOs/data/markit"
+elif os.name == 'posix':
+ root = '/home/share/CorpCDOS/data/markit'
+
+conn = psycopg2.connect(database="ET",
+ user="et_user",
+ password="Serenitas1",
+ host="192.168.1.108")
+cursor = conn.cursor()
+cursor.execute("SELECT dealname FROM latest_clo_universe")
+dealnames = cursor.fetchall()
+
+
+for dealname in dealnames:
+ cursor.execute("SELECT p_cusip, p_curr_subordination, p_curr_thickness from et_deal_subordination(%s)",
+ dealname)
+ cursor.executemany("INSERT INTO et_model_numbers(Cusip, subordination, thickness) VALUES(%s, %s, %s)",
+ cursor.fetchall())
+ conn.commit()
+conn.close()
|
