====== pears.NetCandidateCompliance ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create procedure "pears"."NetCandidateCompliance"( in "pWebUserID" char(20),in "pPersonID" char(20) default null ) result( "Description" char(200),"Behaviour" tinyint,"Status" tinyint,"Score" smallint,"AchievedScore" smallint,"Info" char(100),"Explanation" long varchar ) begin set "pPersonID" = "NetCandidateValidPersonID"("pWebUserID","pPersonID"); if "pPersonID" is null then select null,null,null,null,null,null,null where 0 = 1 else select "Description","Behaviour","Status","Score","AchievedScore","Info", (select first "email" from "tagCompliance" where "taglocation" = "ct"."taglocation" and "tagid" = "ct"."tagid") as "Explanation" from "ComplianceTable"("pPersonID") as "ct" where "Behaviour" <= 2 end if end /* DOC 2019-7-25 MHS created for iw-768 */ /* TEST call NetTestSetup(''); select * from NetCandidateCompliance('x12345yz'); expect EOF; select * from NetCandidateCompliance('TEST','TEST'); -- Just run it. Not bothered about result; */ go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateCompliance" IS {create PROCEDURE pears.NetCandidateCompliance( in pWebUserID char(20), in pPersonID char(20) default null ) result( Description char(200), Behaviour tinyint, Status tinyint, Score smallint, AchievedScore smallint, Info char(100),Explanation long varchar) BEGIN set pPersonID=NetCandidateValidPersonID(pWebUserID,pPersonID); if pPersonID is null then select null,null,null,null,null,null,null where 0=1 else select Description,Behaviour,Status,Score,AchievedScore,Info, (select first email from tagCompliance where taglocation=ct.taglocation and tagid=ct.tagid) as Explanation from ComplianceTable(pPersonID) ct where Behaviour <= 2 end if; END /* DOC 2019-7-25 MHS created for iw-768 */ /* TEST call NetTestSetup(''); select * from NetCandidateCompliance('x12345yz'); expect EOF; select * from NetCandidateCompliance('TEST','TEST'); -- Just run it. Not bothered about result; */ }