====== pears.ShiftOrderReasons ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create procedure "pears"."ShiftOrderReasons"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "DeptID" char(2) ) result( "description" char(50),"tempshiftorderreasonid" char(20),"sortorder" smallint ) begin select "description","tempshiftorderreason"."tempshiftorderreasonid","sortorder" from "tempshiftorderreason" key join "tempshiftorderreasondepartment" where "departmentid" = "DeptID" union select "description","tempshiftorderreason"."tempshiftorderreasonid","sortorder" from "tempshiftorderreason" where not exists(select * from "tempshiftorderreasondepartment" where "tempshiftorderreasonid" = "tempshiftorderreason"."tempshiftorderreasonid") order by "sortorder" asc end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."ShiftOrderReasons" IS {create procedure ShiftOrderReasons /* Application Maintained Function / Procedure - DO NOT EDIT*/ ( in DeptID char(2) ) result( description char(50),tempshiftorderreasonid char(20),sortorder smallint ) begin select description,tempshiftorderreason.tempshiftorderreasonid,sortorder from tempshiftorderreason key join tempshiftorderreasondepartment where departmentid = DeptID union select description,tempshiftorderreason.tempshiftorderreasonid,sortorder from tempshiftorderreason where not exists(select * from tempshiftorderreasondepartment where tempshiftorderreasonid = tempshiftorderreason.tempshiftorderreasonid) order by sortorder asc end }