====== pears.NetOwnerRegistration ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetOwnerRegistration"( in "pWebUserID" char(20),in "pDepartmentID" char(10),in "pCandidateID" char(20) )
result( "departmentid" char(10),"personid" char(20),"departmentname" char(100),"temp" smallint,"perm" smallint )
//IQXNet
begin
select "department"."departmentid",
"pCandidateID" as "personid",
"department"."name",
"search"."temp",
"search"."permanent"
from "department"
key join "search"
where "search"."personid" = "pCandidateID"
and "department"."searchable" = 1
and "department"."publishtoweb" = 1
and "department"."departmentid" = "pDepartmentID"
and("department"."divisionid" is null or "department"."divisionid" = any(select "p"."divisionid" from "person" as "p" where "p"."personid" = "pCandidateID"))
and("department"."divisionid" is null or "department"."divisionid" = any(select "DivisionID" from "DashboardStaffDivisions"()))
end /* DOC
2018-10-05 GJ Created Proc
*/
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetOwnerRegistration" IS
{create PROCEDURE pears."NetOwnerRegistration"( in pWebUserID char(20),in pDepartmentID char(10), in pCandidateID char(20) )
result( departmentid char(10),personid char(20),departmentname char(100),temp smallint,perm smallint )
//IQXNet
begin
SELECT
department.departmentid,
pCandidateID as personid,
department.[name],
[search].[temp],
[search].permanent
from
department
key join [search]
where
[search].personid = pCandidateID
and department.searchable = 1
and department.publishtoweb = 1
and department.departmentid = pDepartmentID
and (department.divisionid is null or department.divisionid in (select p.divisionid from person p where p.personid=pCandidateID))
and (department.divisionid is null or department.divisionid in (select DivisionID from DashboardStaffDivisions()))
end
/* DOC
2018-10-05 GJ Created Proc
*/
}