diff --git a/apply_events.cfm b/apply_events.cfm index 8228bf0..5c3f181 100644 --- a/apply_events.cfm +++ b/apply_events.cfm @@ -37,28 +37,26 @@ - + - - SELECT name_hash, name, price, qty, sum, date_start + + INSERT INTO spec_events (contract_id, supplement_id, seq, action, target_hash, comment, status) + SELECT + , + , + + ROW_NUMBER() OVER (), + 'DELETE', + name_hash, + 'full_replace', + 'applied' FROM spec_current WHERE contract_id = - - - - INSERT INTO spec_events (contract_id, supplement_id, seq, action, target_hash, comment, status) - VALUES ( - , - , - , - 'DELETE', - , - 'full_replace', - 'applied' - ) - - + + SELECT COUNT(*) as cnt FROM spec_current + WHERE contract_id = + + DELETE FROM spec_current WHERE contract_id = @@ -122,7 +120,7 @@ , , , - + , )