====== pears.SelfbillEMailBodyandSubject ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== create function "pears"."SelfbillEMailBodyandSubject"( in "docid" char(20),in "BodyorSubject" char(1) ) returns long varchar begin declare "rv" long varchar; declare "invno" char(12); declare "coname" char(30); declare "crlf" char(2); select "ourref" into "invno" from "iqacdocument" where "documentid" = "docid"; select "dbname" into "coname" from "params"; set "crlf" = "char"(13)+"char"(10); if "BodyorSubject" = 'B' then set "rv" = "string"('Please find Invoice ',"invno",' attached. ',"crlf"); set "rv" = "string"("rv","crlf"); set "rv" = "string"("rv",'Regards',"crlf"); set "rv" = "string"("rv","coname","crlf"); set "rv" = "string"("rv","crlf"); set "rv" = "string"("rv",'If you are not the addressee indicated in this message (or responsible for delivery of the message to such person),'); set "rv" = "string"("rv",'you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email.') else set "rv" = "string"("coname",' Invoice ',"invno") end if; return("rv") end