PLS-00306 : wrong number or types of arguments in call to 'SEND'

604 Views Asked by At

I am bit stuck with this not getting how do I fix the issue

Below is my procedure written , need to send mail where I am using Oracle APEX 20.x

My code :

CREATE OR REPLACE PROCEDURE MYMAIL 
(
x_to IN varchar2,
x_frm IN varchar2,
x_sub IN varchar2,
x_bdoy IN nvarchar2 
)
AS
BEGIN
     apex_application_install.set_workspace_id(555);
     apex_util.set_security_group_id(p_security_group_id => apex_application_install.get_workspace_id); 


APEX_MAIL.SEND
(
x_to => trim(x_to),
x_frm => trim(xfrm),
x_sub => x_sub,
x_body => x_body
);
APEX_MAIL.PUSH_QUEUE;
COMMIT;

END;
/

ERROR :

PLS-00306 : wrong number or types of arguments in call to 'SEND'

Any fix for this is appreciated

1

There are 1 best solutions below

0
On

The documentation for the APEX_MAIL api has the signature for the SEND procedure.

It shows (copied this from "31.10 SEND Procedure Signature 1")

APEX_MAIL.SEND(
    p_to                IN    VARCHAR2,
    p_from              IN    VARCHAR2,
    p_body              IN  [ VARCHAR2 | CLOB ],
    p_body_html         IN  [ VARCHAR2 | CLOB ] DEFAULT NULL,
    p_subj              IN    VARCHAR2 DEFAULT NULL,
    p_cc                IN    VARCHAR2 DEFAULT NULL,
    p_bcc               IN    VARCHAR2 DEFAULT NULL,
    p_replyto           IN    VARCHAR2);

In your code you're invoking APEX_MAIL.SEND with arguments x_to , x_frm ,x_sub ,x_body. That won't work. The exact argument names need to be used and the variables that are passed in as values need to have matching data types