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.psHealthInsertUpdateVacancy ====== <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 procedure "pears"."psHealthInsertUpdateVacancy"( in @VacancyID char(20) ) begin declare "recipid" char(20); select "recipientid" into "recipid" from "vacancy" where "vacancyid" = @VacancyID; if("recipid" is null) or exists(select * from "psHealthVacancy" where "vacancyid" = @Vacancyid) then return end if; -- no resending if "psHealthCanSendPerson"("recipid",'R') = 1 then call "psHealthInsertUpdatePerson"("recipid",'R'); insert into "psHealthVacancy"( "psHealthVacancyID","startDateTime","Status","tenantCaseId","tenantCustomerId","transferbatch","vacancyid","tenantBranchID" ) select "uniquekey"('x'),"startdate",'Referred', "refcode",(select "appnumber" from "person" where "personid" = "recipientid"),0,"vacancyid","psHealthBranch"(null,null,"recipid",'R') from "vacancy" where "vacancyid" = @vacancyid end if end </code> database/procedures/pears_pshealthinsertupdatevacancy.txt Last modified: 2026/08/07 19:24by 127.0.0.1