====== pears.getcontactposition ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create function "pears"."getcontactposition"(
/* Application Maintained Function / Procedure - DO NOT EDIT*/
in "svacancyid" char(20),in "sprogressid" char(20),in "splacementid" char(20) )
returns char(50)
begin
declare "rv" char(50);
if "svacancyid" is not null then
select "position" into "rv" from "vacancy" where "vacancyid" = "svacancyid";
return "rv"
end if;
if "sprogressid" is not null then
select "vacancy"."position" into "rv" from "vacancy" key join "progress"
where "progress"."progressid" = "sprogressid";
return "rv"
end if;
if "svacancyid" is not null then
select "employment"."position" into "rv" from "employment" key join "placement"
where "placement"."placementid" = "splacementid";
return "rv"
end if;
return ''
end