diff options
| -rw-r--r-- | sql/dawn.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index c399da49..aa9b95a1 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -426,7 +426,7 @@ IF NEW.orig_attach IS NULL AND NEW.orig_detach IS NULL THEN RETURN NEW; ELSE SELECT indexfactor, cumulativeloss INTO factor, cum_loss - FROM index_version WHERE redindexcode=NEW.security_id; + FROM index_factors WHERE redindexcode=NEW.security_id; NEW.attach = factor*LEAST(GREATEST((NEW.orig_attach - cum_loss)/factor, 0), 1); NEW.detach = factor*LEAST(GREATEST((NEW.orig_detach - cum_loss)/factor, 0), 1); RETURN NEW; @@ -2978,7 +2978,7 @@ SELECT cds.id, orig_detach, attach, detach, - CASE WHEN protection = 'Buyer' THEN + CASE protection WHEN 'Buyer' THEN 'Seller'::protection ELSE 'Buyer'::protection |
