Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.GetPlacementTheirRef ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."GetPlacementTheirRef"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "persid" char(20),in "vacid" char(20) ) returns char(50) begin declare "rv" char(50); set "rv" = null; "forstat": for "forlab" as "curs" no scroll cursor for select "placement"."theirref" 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 for read only do set "rv" = "theirref"; leave "forstat" end for; if "trim"("isnull"("rv",'')) = '' then select "theirref" into "rv" from "vacancy" where "vacancyid" = "vacid" end if; return("rv") end </code> database/functions/pears_getplacementtheirref.txt Last modified: 2026/08/07 19:24by 127.0.0.1