====== pears.NetVacancyHasRateScript ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetVacancyHasRateScript" IS
{create function pears.NetVacancyHasRateScript(in jtypeid char(20),in vacid char(20))
returns integer
begin
if jtypeid is not null then
if exists(select * from tempjobtype where tempjobtypeid = jtypeid and tempratescriptid is not null) then
return 1
else
return 0
end if
else
if exists(select * from vacancy as v key join tempjobtype as t where v.vacancyid = vacid and t.tempratescriptid is not null) then
return 1
else
return 0
end if
end if
end
}