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.psHealthUpdatePhone ====== <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"."psHealthUpdatePhone"( in "PID" char(20),in "typeid" char(20),in "num" char(100) ) begin -- check email, prim or sec if "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'E-Mail' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"email" = "num" where "personid" = "Pid" elseif "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'Mobile' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"primarytelephone" = "num" where "personid" = "Pid" elseif "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'Home Telephone' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"secondarytelephone" = "num" where "personid" = "Pid" end if end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."psHealthUpdatePhone" IS {create procedure pears."psHealthUpdatePhone"( in PID char(20), in typeid char(20), in num char(100)) begin -- check email, prim or sec if "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'E-Mail' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"email" = "num" where "personid" = "Pid" elseif "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'Mobile' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"primarytelephone" = "num" where "personid" = "Pid" elseif "typeid" = (select first "phonetypeid" from "phonetype" where "name" = 'Home Telephone' and "applicant" = 1) then update "psHealthPerson" set "transferbatch" = 0,"secondarytelephone" = "num" where "personid" = "Pid" end if end } </code> database/procedures/pears_pshealthupdatephone.txt Last modified: 2026/08/07 19:24by 127.0.0.1