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.NetCandidateDivisionID ====== <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 procedure "pears"."NetCandidateDivisionID"( in "pWebUserID" char(20),in "pPersonID" char(20) default null ) result( "divisionID" char(20) ) begin declare "badPersonID" exception for sqlstate value '99009'; set "pPersonID" = "NetCandidateValidPersonID"("pWebUserID","pPersonID"); if "pPersonID" is null then signal "badPersonID" end if; select "p"."divisionid" from "person" as "p" where "p"."personid" = "pPersonID" end /* DOC 2018-12-12 PC return DivisionID for a person. if pPersonID is present then returns divisionID of that person, otherwise returns divisionID of pWebUserID 2018-12-17 MHS enforce standard candidate checking. Raise exception if invalid or ambiguous. */ /* TEST select divisionid from NetCandidateDivisionID('test.candidate',null); expect divisionid=TEST; select divisionid from NetCandidateDivisionID('test.candidate','TEST'); expect divisionid=TEST; */ go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateDivisionID" IS {create PROCEDURE pears."NetCandidateDivisionID"(in pWebUserID char(20),in pPersonID char(20) default null) RESULT( divisionID char(20)) BEGIN DECLARE badPersonID EXCEPTION FOR SQLSTATE '99009'; set pPersonID=NetCandidateValidPersonID(pWebUserID,pPersonID); if pPersonID is null then SIGNAL badPersonID; end if; select p.divisionid from person p where p.personid=pPersonID; END /* DOC 2018-12-12 PC return DivisionID for a person. if pPersonID is present then returns divisionID of that person, otherwise returns divisionID of pWebUserID 2018-12-17 MHS enforce standard candidate checking. Raise exception if invalid or ambiguous. */ /* TEST select divisionid from NetCandidateDivisionID('test.candidate',null); expect divisionid=TEST; select divisionid from NetCandidateDivisionID('test.candidate','TEST'); expect divisionid=TEST; */ } </code> database/procedures/pears_netcandidatedivisionid.txt Last modified: 2026/08/07 19:24by 127.0.0.1