我在Oracle12c过程中使用以下代码片段。
UTL_MAIL.SEND(SENDER => 'abc@x.com',
RECIPIENTS => 'xyz@x.com',
MIME_TYPE => 'text/html',
SUBJECT => SUBJECT,
MESSAGE => EMAIL_STRING);
EMAIL_STRING
属于CLOB
型,以前运行良好。现在,电子邮件字符串长度已经增加(变为62598,这是动态的(,并开始给出以下错误。
Error report -
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "PROCEDURE_NAME", line 67
ORA-06512: at line 1
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause: An arithmetic, numeric, string, conversion, or constraint error
occurred. For example, this error occurs if an attempt is made to
assign the value NULL to a variable declared NOT NULL, or if an
attempt is made to assign an integer larger than 99 to a variable
declared NUMBER(2).
*Action: Change the data, how it is manipulated, or how it is declared so
that values do not violate constraints.
如何使用UTL_MAIL.SEND
发送大型CLOB作为消息体?
@Wernfried Domscheit评论道,我遵循了如何将数据从日志表导出到oracle中的电子邮件正文,并在过程中使用下面的代码段来调用新创建的包。
MAILING.SendMail(
Subject => SUBJECT,
Message => EMAIL_STRING,
ToMail => VARCHAR_TABLE_TYPE('toEmailid1','toEmailid2'),
FromMail => 'fromEmailId',
FromName => 'fromName');