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.NetVacancyRoleAllowed ====== <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"."NetVacancyRoleAllowed"( in "pWebUserID" char(20),in "pVacancyID" char(20),in "pVacancyRoleExternalCode" char(20) ) returns smallint begin if not exists(select * from "VacancyRoleAllocation" as "a" key join "VacancyRole" as "r" where "a"."VacancyID" = "pVacancyID" and "r"."ExternalCode" = "pVacancyRoleExternalCode") then return 1 -- Nobody assigned to this role - anyone can do end if; if exists(select * from "VacancyRoleAllocation" as "a" key join "VacancyRole" as "r","VacancyRoleAllocation" as "a" key join "employment" key join "iqxnetuserlink" as "x" where "a"."VacancyID" = "pVacancyID" and "r"."ExternalCode" = "pVacancyRoleExternalCode" and "x"."IQXNetUserID" = "pWebUserID") then return 1 end if; return 0 end </code> database/functions/pears_netvacancyroleallowed.txt Last modified: 2026/08/07 19:24by 127.0.0.1