blob: 72e9f6f3b06d131bc18a94c282028509d10c2f39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()
|