====== pears.NetOwnerVacancyDetails ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetOwnerVacancyDetails"( in "pWebUserID" char(20),in "pVacancyID" char(20) )
result( "ObjID" char(20),"Position" char(50),"Their_Ref" char(50),"Start_Date__DT" date,"Finish_Date__DT" date,"Expiry_Date__DT" date,"Our_Ref" char(20),"Contract_Ref" char(20),"Notes" long varchar )
// IQXWeb
begin
declare "divid" char(20);
set "divid" = (select first "staff"."divisionid" from "iqxnetuser" key join "staff" where "iqxnetuser"."iqxnetuserid" = "pwebuserid");
if "divid" is null then
return
end if;
if "isnull"("pVacancyID",'') = '' then
select '','','',null,null,null,'','',''
else
select "vacancy"."vacancyid" as "ObjID",
"vacancy"."position" as "Position",
"vacancy"."TheirRef" as "Their_Ref",
"vacancy"."startdate" as "Start_Date__DT",
"vacancy"."FinishDate" as "Finish_Date__DT",
"vacancy"."expiry" as "Expiry_Date__DT",
"vacancy"."refcode" as "Our_Ref",
"vacancy"."ContractRef" as "Contract_Ref",
"vacancy"."othernotes" as "Notes"
from "vacancy" key join "employment" key join "company"
where "vacancyid" = "pVacancyID" and "company"."divisionid" = "divid"
end if
end /* DOC
2017-06-05 PC Test and doc
*/
/* TEST
call NetTestSetup('');
update iqxnetuserlink set employmentid=null where IQXNetUserLinkID in ('test.client','test.agency','test.candidate','test.owner');
update iqxnetuserlink set employmentid='TEST' where IQXNetUserLinkID='test.owner';
update company set divisionid='TEST' where companyid='TEST';
update staff set divisionid='TEST' where staffid='TEST';
select replace(ObjID,'','!') as A from NetOwnerVacancyDetails(null,null);
expect EOF;
select '!'+ObjID+'!' as B from NetOwnerVacancyDetails('test.owner',null);
expect B=!!;
select replace(ObjID,'','!') as C from NetOwnerVacancyDetails('test.owner','TEST');
expect C=TEST;
*/
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerVacancyDetails" IS
{create PROCEDURE pears."NetOwnerVacancyDetails"( in "pWebUserID" char(20),in "pVacancyID" char(20) )
result( "ObjID" char(20),"Position" char(50),"Their_Ref" char(50),"Start_Date__DT" date,"Finish_Date__DT" date,"Expiry_Date__DT" date,"Our_Ref" char(20),"Contract_Ref" char(20),"Notes" long varchar )
// IQXWeb
begin
declare "divid" char(20);
set "divid" = (select first "staff"."divisionid" from "iqxnetuser" key join "staff" where "iqxnetuser"."iqxnetuserid" = "pwebuserid");
if "divid" is null then
return
end if;
if "isnull"("pVacancyID",'') = '' then
select '','','',null,null,null,'','',''
else
select "vacancy"."vacancyid" as "ObjID",
"vacancy"."position" as "Position",
"vacancy"."TheirRef" as "Their_Ref",
"vacancy"."startdate" as "Start_Date__DT",
"vacancy"."FinishDate" as "Finish_Date__DT",
"vacancy"."expiry" as "Expiry_Date__DT",
"vacancy"."refcode" as "Our_Ref",
"vacancy"."ContractRef" as "Contract_Ref",
"vacancy"."othernotes" as "Notes"
from "vacancy" key join "employment" key join "company"
where "vacancyid" = "pVacancyID" and "company"."divisionid" = "divid"
end if
end
/* DOC
2017-06-05 PC Test and doc
*/
/* TEST
call NetTestSetup('');
update iqxnetuserlink set employmentid=null where IQXNetUserLinkID in ('test.client','test.agency','test.candidate','test.owner');
update iqxnetuserlink set employmentid='TEST' where IQXNetUserLinkID='test.owner';
update company set divisionid='TEST' where companyid='TEST';
update staff set divisionid='TEST' where staffid='TEST';
select replace(ObjID,'','!') as A from NetOwnerVacancyDetails(null,null);
expect EOF;
select '!'+ObjID+'!' as B from NetOwnerVacancyDetails('test.owner',null);
expect B=!!;
select replace(ObjID,'','!') as C from NetOwnerVacancyDetails('test.owner','TEST');
expect C=TEST;
*/
}