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 }