pears.SelfbillDescriptionForTimesheetLine

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

Original SQL

CREATE FUNCTION "pears"."SelfbillDescriptionForTimesheetLine"( 
  IN "tslineid" CHAR(20),IN "suppliercode" CHAR(12) ) 
RETURNS long VARCHAR
BEGIN
  DECLARE "rv" long VARCHAR;
  SET "rv" = NULL;
  SELECT "string"("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