diff options
Diffstat (limited to 'python/load_intex_collateral.py')
| -rw-r--r-- | python/load_intex_collateral.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py index c96bb11f..30e76806 100644 --- a/python/load_intex_collateral.py +++ b/python/load_intex_collateral.py @@ -111,15 +111,19 @@ def upload_data(dealnames, workdate, conn, cursor): if reinsert or not old_update_dates or updatedate not in old_update_dates: tag = 0 for row in data: + # these next three ifs are to take care of reinvestment asset lines + if not row[0]: + row[0] = 'Reinv' if row[4] and 'Reinvest' in row[4]: row[4] = row[4].replace("Reinvest ", "") + if row[4] and len(row[4])>10: + row[4] = row[4][:9] sql_fields = ["dealname", "updatedate", "name", "IssuerName", "CurrentBalance", "Maturity", "AssetSubtype", "AssetType", "GrossCoupon", "Spread", "Frequency", "NextPaydate", "SecondLien", "LoanXID", "Cusip", "IntexPrice", "IntexPriceSource", "IntexPriceDate", "FixedOrFloat", "DefaultedFlag", "CovLite", "isCDO", "Liborfloor", "ReinvFlag"] - sqlstr = "INSERT INTO ET_COLLATERAL({0}) VALUES({1})".format(",".join(sql_fields), ",".join(["%s"] * len(sql_fields))) try: |
