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.AWRPlacement ====== <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"."AWRPlacement"( in "vacid" char(20),in "persid" char(20),in "shiftid" char(20) ) returns char(20) begin declare "rv" char(20); -- finds placementid for use in AWR set "rv" = null; if "shiftid" is not null then select "placementid" into "rv" from "tempshift" where "tempshiftid" = "shiftid" end if; if "rv" is null then select first "placementid" into "rv" from "placement" key join "employment" where "personid" = "persid" and "vacancyid" = "vacid" order by "isnull"("employment"."leavedate",current date+3650) desc end if; if "rv" is null then -- set rv = uniquekey(persid); -- insert into placement () values () ; -- might create one and return ID ??? end if; return "rv" end </code> database/functions/pears_awrplacement.txt Last modified: 2026/08/07 19:24by 127.0.0.1