问题
I want to create a procedure but i am having trouble while passing the arguments inside a function
This is my code:
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');
It works just fine and everytime it runs i got this output:
|The concurrent Sales with request_id 987987678 ended with status WARNING|987987678
Now, i want to create a PROCEDURE using the query written above.. i want to send a mail with that information
This is what i got so far:
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;
But this is NOT working. I want to receive the mail and that's why i am using this oracle function utl_mail.send
I need to receive this message inside the mail:
The concurrent Sales with request_id 987987678 ended with status WARNING
Also, how can i send this message to many other people? Can i use the same variable v_email_test
来源:https://stackoverflow.com/questions/59061291/passing-arguments-inside-procedure-message-not-working-oracle