====== pears.GetShiftBookedDescription ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetShiftBookedDescription" IS {create function GetShiftBookedDescription /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in vid char(20), in pid char(20), in edate date) returns char(250) begin declare rv char(250); for fetchfor as fetchcursor no scroll cursor for select string(GetTempName(pid), ' (', tempshiftplan.description, ',' ,dateformat(tempshift.timefrom, 'hh:nn'), '-' ,dateformat(tempshift.timeto, 'hh:nn'), ')') as bdesc from tempshift key join (vacancy, tempshiftplan, person) where vacancy.vacancyid=vid and tempshift.shiftdate = edate and tempshift.personid = pid and not tempshift.state in ('U','C') order by tempshift.timefrom,person.keyname for read only do if rv<>'' then set rv=rv +bdesc + ', '; end if; set rv=rv +bdesc ; end for; return rv; end }