Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.AutoMatchRemoveShiftFromQueue ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create procedure "pears"."AutoMatchRemoveShiftFromQueue"( in @TempShiftPlanID char(20),@State char(1),@Refill smallint ) begin if @State in( 'P','B' ) then update "AutoMatchShiftQueue" set "NotRequired" = 1 where "TempshiftPlanID" = @TempShiftPlanID and "completed" is null; update "AutoMatchNotificationQueue" set "NotRequired" = 1 where "TempshiftPlanID" = @TempShiftPlanID and "emailcompleted" is null and "SMScompleted" is null and "Pushcompleted" is null end if; if(@State = 'C') and("isnull"(@Refill,0) = 0) then update "AutoMatchShiftQueue" set "NotRequired" = 1 where "TempshiftPlanID" = @TempShiftPlanID and "completed" is null; update "AutoMatchNotificationQueue" set "NotRequired" = 1 where "TempshiftPlanID" = @TempShiftPlanID and "emailcompleted" is null and "SMScompleted" is null and "Pushcompleted" is null end if end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."AutoMatchRemoveShiftFromQueue" IS {create procedure AutoMatchRemoveShiftFromQueue ( IN @TempShiftPlanID char(20), @State char(1), @Refill smallint ) begin if @State in ('P','B') then update AutoMatchShiftQueue set NotRequired = 1 where TempshiftPlanID = @TempShiftPlanID and completed is null; update AutoMatchNotificationQueue set NotRequired = 1 where TempshiftPlanID = @TempShiftPlanID and emailcompleted is null and SMScompleted is null and Pushcompleted is null; end if; if (@State = 'C') and (isnull(@Refill,0) = 0) then update AutoMatchShiftQueue set NotRequired = 1 where TempshiftPlanID = @TempShiftPlanID and completed is null; update AutoMatchNotificationQueue set NotRequired = 1 where TempshiftPlanID = @TempShiftPlanID and emailcompleted is null and SMScompleted is null and Pushcompleted is null; end if; end } </code> database/procedures/pears_automatchremoveshiftfromqueue.txt Last modified: 2026/08/07 19:24by 127.0.0.1