pears.tempslotstartdate
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
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