sql - 在过程(消息)中传递参数不起作用 - oracle
问题描述
我想创建一个过程,但在函数内部传递参数时遇到问题
这是我的代码:
select 'The concurrent '||program||' with request_id '||request_id||' ended with status '||
status as message, request_id
from
(
<the subquery>
)
where rn = 1
and status in ('WARNING','ERROR','STAND BY');
它工作得很好,每次运行时我都会得到这个输出:
|The concurrent Sales with request_id 987987678 ended with status WARNING|987987678
现在,我想使用上面编写的查询创建一个 PROCEDURE .. 我想发送一封包含该信息的邮件
这是我到目前为止得到的:
create or replace procedure pr_mail_me is
v_email_test varchar2(100) := 'myemail@random.com';
cursor crs_request is
select 'The concurrent '||program||' with request_id '||request_id||' ended with status '||
status as message, request_id
from
(
<the subquery>
)
where rn = 1
and status in ('WARNING','ERROR','STAND BY');
begin
for c in crs_request
loop
begin
utl_mail.send(sender => 'sendercompany@test.com',recipients => v_email ,subject => 'Concurrents' ,message => c.message);
end;
end loop;
end;
但这不起作用。我想接收邮件,这就是我使用这个 oracle 函数utl_mail.send的原因
我需要在邮件中收到此消息:
request_id 为 987987678 的并发销售以状态 WARNING 结束
另外,我怎样才能将此消息发送给许多其他人?我可以使用相同的变量 v_email_test
解决方案
推荐阅读
- ios - 如何擦除右下角的细边线?
- django - 外键问题。Django 迁移
- r - Reprex 无法打开连接,文件路径错误?
- ruby - 如何在 Google colaboratory 上突出显示 Ruby 的语法?
- c# - 命名空间中无法识别的模型
- javascript - BeforeAll 与 BeforeEach。什么时候使用它们?
- opencv - SURF:我们如何从关键点半径中获得 sigma 的值
- swift - 每行适合 2 个集合视图单元格(在所有设备上都相同)
- javascript - Firefox 中的 jmedia:禁用 Flash 时返回 Flash 版本
- android - 如何在 Nativescript 中获取 mac 地址和 ip?