database:functions:pears_tempslotstartdate



pears.tempslotstartdate

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

CREATE FUNCTION "pears"."tempslotstartdate"( IN "tsid" CHAR(20) ) 
RETURNS DATE
BEGIN
  DECLARE "rv" DATE;
  SELECT "employment"."startdate" INTO "rv" FROM "tempslot" KEY JOIN "placement" KEY JOIN "employment"
    WHERE "tempslot"."tempslotid" = "tsid";
  IF "rv" IS NULL THEN
    SELECT "weekenddate"("tempslot"."yearnumber","tempslot"."weeknumber") INTO "rv" FROM "tempslot"
      WHERE "tempslotid" = "tsid"
  END IF;
  IF "rv" IS NULL THEN
    SET "rv" = CURRENT DATE
  END IF;
  RETURN("rv")
END
  • database/functions/pears_tempslotstartdate.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1