【发布时间】:2022-09-27 18:35:25
【问题描述】:
我有一个有效的存储过程,如下所示
Declare
l_id number;
begin
l_id := apex_mail.send(
p_to => \'test@test.com\',
p_from => \'test@test.com\',
p_subj => \'Mail from APEX with attachment\',
p_body => \'Please review the attachment.\',
p_body_html => \'Please review the attachment.\'
);
apex_mail.add_attachment(
p_mail_id => l_id,
p_attachment => p_output_blob,
p_filename => p_output_filename,
p_mime_type => p_output_mime_type
);
end;
此过程在下载附件后通过电子邮件发送附件,这正是我想要的。然而,这个问题是,我希望p_to 根据我的表中名为TEMP_FEES 的新email_address 进行更改。该表一次将有一个记录/电子邮件地址。
我努力了
Declare
l_id number;
begin
FOR m IN (SELECT parent_email
FROM TEMP_FEES
)
LOOP
apex_mail.send( p_to => m.parent_email,
p_from => \'test@test.com\',
p_body => \'test\',
p_subj => \'invoice\'
);
apex_mail.add_attachment(
p_mail_id => l_id,
p_attachment => p_output_blob,
p_filename => p_output_filename,
p_mime_type => p_output_mime_type
);
END LOOP;
end
但我收到一个错误
ORA-20022: 为参数 P_mail_id 提供了空值
当我提交表格时。
我可以就如何解决这个问题获得任何建议吗?
-
您是否验证了 TEMP_FEES.PARENT_EMAIL 是否为空?如果您刚刚更新了该表中的行,您是犯罪这些变化?
-
是的,parent_email 不为空,是的,更改已提交
-
在第二个块中,当您调用
apex_mail.send时,您不再为l_id赋值。因此,当您调用add_attachment时,l_id仍然是null。因此,p_mail_id是null。
标签: oracle oracle11g oracle-apex oracle-apex-5.1