Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
CREATE FUNCTION "pears"."GetPhone"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ IN "cpe" CHAR(2),IN "ptype" CHAR(25),IN "recid" CHAR(20) ) RETURNS CHAR(250) BEGIN DECLARE "rv" CHAR(250); SELECT "list"("phone"."number",'; ') INTO "rv" FROM "phone" KEY JOIN "phonetype" WHERE "phone"."whoid" = "recid" AND "phone"."who" = (IF "cpe" = 'E' THEN 'CP' ELSE "cpe" endif) AND "phonetype"."name" = "ptype"; RETURN("rv") END