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.GenerateContactEventEmailLog ====== <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"."GenerateContactEventEmailLog"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "pcontacteventid" char(20),in "pWhenSent" timestamp default current timestamp,in "pRecipients" long varchar default null, in "pAttachments" long varchar default null,in "pDirection" char(3) default 'OUT',in "pMethod" char(10) default 'EMAIL' ) begin declare "column_not_found" exception for sqlstate value '52003'; insert into "ContactEventEmailLog"( "ContactEventEmailLogID","ContactEventID","WhenSent","Recipients","Attachments","Direction","Method" ) values ( "Uniquekey"("pContactEventID"),"pContactEventID","pWhenSent","pRecipients","pAttachments","pDirection","pMethod" ) exception when "column_not_found" then insert into "ContactEventEmailLog"( "ContactEventEmailLogID","ContactEventID","WhenSent","Recipients","Attachments" ) values ( "Uniquekey"("pContactEventID"),"pContactEventID","pWhenSent","pRecipients","pAttachments" ) when others then resignal end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GenerateContactEventEmailLog" IS {create procedure GenerateContactEventEmailLog /* Application Maintained Function / Procedure - DO NOT EDIT*/ ( in "pcontacteventid" CHAR(20) , in"pWhenSent" timestamp Default current timestamp,in"pRecipients" long varchar default null, in"pAttachments" long varchar default null, in "pDirection" Char(3) default 'OUT', in "pMethod" char(10) Default 'EMAIL' ) begin DECLARE column_not_found EXCEPTION FOR SQLSTATE '52003'; insert into ContactEventEmailLog ( ContactEventEmailLogID,ContactEventID,WhenSent,Recipients,Attachments,Direction,Method) values(Uniquekey(pContactEventID),pContactEventID,pWhenSent,pRecipients,pAttachments,pDirection,pMethod); EXCEPTION WHEN column_not_found THEN insert into ContactEventEmailLog ( ContactEventEmailLogID,ContactEventID,WhenSent,Recipients,Attachments) values(Uniquekey(pContactEventID),pContactEventID,pWhenSent,pRecipients,pAttachments); WHEN OTHERS THEN RESIGNAL; end } </code> database/procedures/pears_generatecontacteventemaillog.txt Last modified: 2026/08/07 19:24by 127.0.0.1