pears.GetPlacementID
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
CREATE FUNCTION "pears"."GetPlacementID"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ IN "persid" CHAR(20),IN "vacid" CHAR(20) ) RETURNS CHAR(20) BEGIN FOR "forlab" AS "curs" dynamic scroll cursor FOR SELECT "placement"."placementid" FROM "placement" KEY JOIN "employment" WHERE "placement"."vacancyid" = "vacid" AND "employment"."personid" = "persid" AND "placement"."temp" <> 0 ORDER BY "isnull"("employment"."leavedate",CURRENT DATE+3650) DESC do RETURN("placementid") END FOR; RETURN(NULL) END