Start Processing : 2025-03-15 01:41:05
0 rows affectedupdate db_opportunity_hist a
inner join
db_opportunity b
on a._opportunityID = b._opportunityID
set a._accountID = b._accountID
[5] 1.2 seconds -> 0 rows affected
UPDATE db_opportunity_hist
SET
_createdTS = STR_TO_DATE(_createdDate, '%c/%e/%Y'),
_closeTS= STR_TO_DATE(_closeDate, '%c/%e/%Y');
[10] 0.22 seconds -> 0 rows affected
UPDATE db_opportunity_hist
SET _lastStageChangeTS = STR_TO_DATE(_lastStageChangeDate, '%c/%e/%Y')
where _lastStageChangeDate != ''
[20] 0.23 seconds -> 0 rows affected
update db_opportunity_hist
set _fromCode =
case
when _fromStage = '' then 0
when _fromStage = '00 - Interest' then 1
when _fromStage = '01 - Qualification' then 2
when _fromStage = '01 - Preparation' then 2
when _fromStage = '02 - Discovery' then 3
when _fromStage = '03 - Solution' then 4
when _fromStage = '04 - Proposal' then 5
when _fromStage = '05 - Selection' then 6
when _fromStage = '06 - Contract Negotiation' then 7
when _fromStage = 'Closed Duplicate' then 0
when _fromStage = 'Closed ? No Decision/Not Now' then 0
when _fromStage = 'Closed Lost' then 0
when _fromStage = 'Closed Won' then 8
when _fromStage = 'Rejected - No Opportunity' then 0
when _fromStage = '01 - Preparation' then 2
when _fromStage = '01 - Qualification' then 2
when _fromStage = 'Engage/Discovery' then 3
when _fromStage = 'Solution Presentation' then 4
when _fromStage = 'Proposal' then 5
when _fromStage = 'Negotiation & Selection' then 6
when _fromStage = 'Contracting' then 7
when _fromStage = 'Closed Lost' then 0
when _fromStage = 'Closed Won' then 8
else ''
end;
[30] 0.22 seconds -> 0 rows affected
update db_opportunity_hist
set _toCode =
case
when _toStage = '' then 0
when _toStage = '00 - Interest' then 1
when _toStage = '01 - Qualification' then 2
when _toStage = '01 - Preparation' then 2
when _toStage = '02 - Discovery' then 3
when _toStage = '03 - Solution' then 4
when _toStage = '04 - Proposal' then 5
when _toStage = '05 - Selection' then 6
when _toStage = '06 - Contract Negotiation' then 7
when _toStage = 'Closed Duplicate' then 0
when _toStage = 'Closed ? No Decision/Not Now' then 0
when _toStage = 'Closed Lost' then 0
when _toStage = 'Closed Won' then 8
when _toStage = 'Rejected - No Opportunity' then 0
when _toStage = '01 - Preparation' then 2
when _toStage = '01 - Qualification' then 2
when _toStage = 'Engage/Discovery' then 3
when _toStage = 'Solution Presentation' then 4
when _toStage = 'Proposal' then 5
when _toStage = 'Negotiation & Selection' then 6
when _toStage = 'Contracting' then 7
when _toStage = 'Closed Lost' then 0
when _toStage = 'Closed Won' then 8
else ''
end;
[40] 0.16 seconds -> 0 rows affected
update db_opportunity_hist
set _mvmt = _toCode - _fromCode
[50] 0.12 seconds -> 0 rows affected