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.ComplianceSummary ====== <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> COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."ComplianceSummary" IS {create function ComplianceSummary /* Application Maintained Function / Procedure - DO NOT EDIT*/ ( in "pPersonID" char(20) ) returns long varchar begin declare "errMsg" long varchar; declare "warnMsg" long varchar; declare "act" double; declare "poss" double; declare "xScore" char(20); set "act" = 0; set "poss" = 0; for "PFOR" as "PCUR" no scroll cursor for select "Description","Status","Info","AchievedScore","Score" from "ComplianceTable"("pPersonID") for read only do case "status" when 1 then set "errMsg" = "string"("errMsg","Description",' ',"Info",'. ') when 2 then set "warnMsg" = "string"("warnMsg","Description",' ',"Info",'. ') end case; set "act" = "act"+"isnull"("AchievedScore",0.0); set "poss" = "poss"+"isnull"("Score",0.0) end for; if "warnMsg" is not null then set "warnMsg" = "string"('Warning: ',"warnMsg") end if; if "poss" <= 0 then set "xScore" = '' else set "xScore" = "trim"("str"(("act"/"poss")*100.0))+'% ' end if; return "string"("xScore","errMsg","warnMsg") end } </code> database/procedures/pears_compliancesummary.txt Last modified: 2026/08/07 19:24by 127.0.0.1