diff options
| -rw-r--r-- | python/load_indicative.py | 7 | ||||
| -rw-r--r-- | sql/et_tables.sql | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/python/load_indicative.py b/python/load_indicative.py index 864d609e..8ee2d222 100644 --- a/python/load_indicative.py +++ b/python/load_indicative.py @@ -113,12 +113,13 @@ def upload_deal_data(conn, filename): line["Paid Down"] = re.sub("Paid Down: ","", line["Latest Update"]) line["Latest Update"] = line["Paid Down"] for field in ["Deal Issue Date", "Deal Termination Date", \ - "Deal Next Pay Date", "Reinv End Date", "Latest Update"]: + "Deal Next Pay Date", "Reinv End Date", "Latest Update", "Pay Day"]: if line[field]: try: line[field] = datetime.datetime.strptime(line[field], '%b %d, %Y').date() except ValueError: pdb.set_trace() + for key in ["Collection Account Principal Balance", "Collection Account Interest Balance", "Orig Deal Bal", "Curr Deal Bal", "Tranche Curr Bal", "Tranche Orig Bal", "CDO Pct of Assets that are Structured Finance Obligations", @@ -137,8 +138,8 @@ def upload_deal_data(conn, filename): "%(Collection Account Principal Balance)s," \ "%(Collection Account Interest Balance)s, %(CDOpercent)s, %(defaultedbal)s, " \ "%(Coupon)s, %(Deal Issue Date)s," \ - "%(Deal Termination Date)s, %(Deal Next Pay Date)s," \ - "%(Reinv End Date)s, %(Latest Update)s, %(Deal CUSIP List)s, %(Paid Down)s)" + "%(Deal Termination Date)s, %(Deal Next Pay Date)s, %(Reinv End Date)s, " \ + "%(Latest Update)s, %(Deal CUSIP List)s, %(Paid Down)s, %(Pay Day)s)" try: with conn.cursor() as c: c.execute(sqlstring, line) diff --git a/sql/et_tables.sql b/sql/et_tables.sql index c7e720e5..430f0ff6 100644 --- a/sql/et_tables.sql +++ b/sql/et_tables.sql @@ -224,6 +224,7 @@ CREATE TABLE clo_universe ( "Latest Update" date, "Deal Cusip List" text[], PaidDown date, + "Pay Day" date, PRIMARY KEY (dealname, "Latest Update") ); @@ -278,7 +279,7 @@ CREATE OR REPLACE FUNCTION historical_clo_universe(p_dealname varchar(10), p_dat "Principal Bal" float, "Interest Bal" float, "CDO Percentage" float, "Defaulted Bal" float, "Curr Coupon" float, "Deal Issue Date" date, maturity date, "Deal Next Pay Date" date, "Reinv End Date" date, - "Latest Update" date, "Deal Cusip List" text[], paiddown date) AS $$ + "Latest Update" date, "Deal Cusip List" text[], paiddown date, "Pay Day" date) AS $$ DECLARE latestdate date; BEGIN SELECT max(clo_universe."Latest Update") INTO latestdate FROM clo_universe |
