====== pears.NetPersonProfileSet ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetPersonProfileSet"( in "pWebUserID" char(20),in "ppersonid" char(20),in "pdob" char(20) default 'NOT-SET',in "phomephone" char(250) default 'NOT-SET',in "pemail" char(250) default 'NOT-SET',in "pOLDdob" char(20) default 'NOT-SET',in "pOLDhomephone" char(250) default 'NOT-SET',in "pOLDemail" char(250) default 'NOT-SET' )
result( "pResult" char(250) )
begin
declare "dateofbirth" date;
if not "ppersonid" = any(select "personid" from "iqxnetuserlink" where "iqxnetuserid" = "pwebuserid") then
select '99:~Permission denied';
return
end if;
if "isnull"("pdob",'') <> "isnull"("pOLDdob",'') then
set "dateofbirth" = "IQXNetStringToDate"("pdob");
if "trim"("isnull"("pdob",'')) <> '' and "dateofbirth" is null then
select '1:~Invalid date of birth';
return
end if;
update "person" set "dob" = "dateofbirth" where "personid" = "ppersonid"
end if;
if "isnull"("phomephone",'') <> "isnull"("pOLDhomephone",'') then
call "setphone"('P','Home Telephone',"ppersonid","phomephone")
end if;
if "isnull"("pemail",'') <> "isnull"("pOLDemail",'') then
call "setphone"('P','E-mail',"ppersonid","pemail");
update "iqxnetuserlink" key join "iqxnetuser" set "iqxnetuser"."emailaddress" = "pemail" where "iqxnetuserlink"."personid" = "ppersonid"
end if;
select '0:~Success'
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetPersonProfileSet" IS
{create procedure pears."NetPersonProfileSet"( in "pWebUserID" char(20),in "ppersonid" char(20),in "pdob" char(20) default 'NOT-SET',in "phomephone" char(250) default 'NOT-SET',in "pemail" char(250) default 'NOT-SET',in "pOLDdob" char(20) default 'NOT-SET',in "pOLDhomephone" char(250) default 'NOT-SET',in "pOLDemail" char(250) default 'NOT-SET' )
result( "pResult" char(250) )
begin
declare "dateofbirth" date;
if not "ppersonid" = any(select "personid" from "iqxnetuserlink" where "iqxnetuserid" = "pwebuserid") then
select '99:~Permission denied';
return
end if;
if "isnull"("pdob",'') <> "isnull"("pOLDdob",'') then
set "dateofbirth" = "IQXNetStringToDate"("pdob");
if "trim"("isnull"("pdob",'')) <> '' and "dateofbirth" is null then
select '1:~Invalid date of birth';
return
end if;
update "person" set "dob" = "dateofbirth" where "personid" = "ppersonid"
end if;
if "isnull"("phomephone",'') <> "isnull"("pOLDhomephone",'') then
call "setphone"('P','Home Telephone',"ppersonid","phomephone")
end if;
if "isnull"("pemail",'') <> "isnull"("pOLDemail",'') then
call "setphone"('P','E-mail',"ppersonid","pemail");
update "iqxnetuserlink" key join "iqxnetuser" set "iqxnetuser"."emailaddress" = "pemail" where "iqxnetuserlink"."personid" = "ppersonid"
end if;
select '0:~Success'
end
}