pears.TempaidTempEmaill
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
CREATE FUNCTION "pears"."TempaidTempEmaill"( IN "pid" CHAR(20) ) RETURNS VARCHAR(100) BEGIN DECLARE "rv" VARCHAR(100); SELECT "isnull"("person"."payrollemailaddress",(SELECT FIRST "phone"."number" FROM "phone" KEY JOIN "phonetype" WHERE "phone"."who" = 'P' AND "phone"."whoid" = "pid" AND "phonetype"."name" LIKE '%E%mail%'),'') INTO "rv" FROM "person" WHERE "personid" = "pid"; RETURN("rv") END