diff options
| -rw-r--r-- | sql/dawn.sql | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 65d53060..14464c54 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -738,6 +738,7 @@ RETURN QUERY END; $$ LANGUAGE plpgsql; + CREATE OR REPLACE function list_cds_positions_by_strat_fcm(p_date date, p_fcm text) RETURNS TABLE(security_id varchar(12), security_desc varchar(32), maturity date, @@ -748,7 +749,7 @@ RETURN QUERY cds.currency, cds.folder, SUM(cds.notional) OVER (PARTITION BY cds.security_id, cds.maturity, cds.folder, cds.fcm) AS notional - FROM list_cds(p_date) cds WHERE (cds.attach is NULL AND cds.folder != 'MBSCDS' AND cds.fcm=fcm)) + FROM list_cds(p_date) cds WHERE (cds.attach is NULL AND cds.folder != 'MBSCDS' AND cds.fcm=p_fcm)) SELECT DISTINCT ON (tmp.security_id, tmp.maturity, tmp.folder) * FROM tmp WHERE tmp.notional!=0; END; $$ LANGUAGE plpgsql; |
