pears.DescriptionForTimesheetLine

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

Original SQL

CREATE FUNCTION "pears"."DescriptionForTimesheetLine"( IN "tslineid" CHAR(20) ) 
RETURNS long VARCHAR
BEGIN
  DECLARE "rv" long VARCHAR;
  SET "rv" = NULL;
  SELECT "string"('W/e ',"dateformat"("weekmonthenddate"("temptimesheet"."period","temptimesheet"."periodlength"),'dd/mm/yy'),' ',"person"."name",' ',"temppayband"."description",' ',"isnull"("temptimesheetline"."description","temppayband"."unit"))
    INTO "rv"
    FROM "temptimesheetline" KEY JOIN("temppayband",("temptimesheet" KEY JOIN "person"))
    WHERE "temptimesheetline"."temptimesheetlineid" = "tslineid";
  RETURN("rv")
END