pears.ComplianceValidPerson

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE FUNCTION "pears"."ComplianceValidPerson"( 
  /* Application Maintained Function / Procedure - DO NOT EDIT*/
  IN "pPersonID" CHAR(20),IN "pIncludeWarnings" INTEGER ) 
RETURNS long VARCHAR
BEGIN
  DECLARE "errMsg" long VARCHAR;
  DECLARE "warnMsg" long VARCHAR;
  FOR "PFOR" AS "PCUR" no scroll cursor FOR
    SELECT "Description","Status","Info"
      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
  END FOR;
  IF "pIncludeWarnings" = 0 THEN
    SET "warnMsg" = NULL
  END IF;
  IF "warnMsg" IS NOT NULL THEN
    SET "warnMsg" = "string"('Warning: ',"warnMsg")
  END IF;
  RETURN "nullif"("string"("errMsg","warnMsg"),'')
END
  • database/functions/pears_compliancevalidperson.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1