diff options
| -rw-r--r-- | sql/dawn.sql | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 82820adf..302e4ead 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -683,7 +683,8 @@ CREATE TYPE LIST_CDS AS( detach float, fcm text, initial_margin_percentage float, - cpty_id text + cpty_id text, + cp_code varchar(12) ); CREATE OR REPLACE function list_cds(p_date date, p_fund fund DEFAULT 'SERCGMAST'::fund) @@ -695,7 +696,8 @@ SELECT id, trade_date, security_id, security_desc, maturity, fixed_rate, currenc (CASE WHEN cds.protection='Buyer' THEN 1 ELSE -1 END) AS notional, orig_attach, orig_detach, attach, detach, account_code, initial_margin_percentage, - cpty_id + cpty_id, + cp_code FROM cds LEFT JOIN ( SELECT dealid, SUM(termination_amount) AS terminated_amount FROM terminations WHERE termination_date <= p_date GROUP BY dealid) b USING (dealid) |
