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 }