Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00201: identifier 'UTL_MAIL' must be declared (11.2.0.4)
PLS-00201: identifier 'UTL_MAIL' must be declared [message #664150] Wed, 05 July 2017 06:21 Go to next message
grpatwari
Messages: 288
Registered: June 2008
Location: Hyderabad
Senior Member
Hi,

This is the first time I am using utl_mail. I would like to send jobs success/failure status mails to recipients so I am using utl_mail procedure for testing purpose. I have followed the below link still I am getting the error. Please advice on this.

http://dbaclass.com/article/how-to-send-mail-using-utl_mail-in-oracle-11g/

DECLARE
vSender VARCHAR2(30) := 'gprao@yahoo.com';
vRecip  VARCHAR2(30) := 'gprao@yahoo.com';
vSubj  VARCHAR2(50) := 'hi';
vMesg  VARCHAR2(4000) := 'test';
vMType  VARCHAR2(300) := 'text/plain; charset=us-ascii';
BEGIN
utl_mail.send (vSender, vRecip, NULL, NULL, vSubj, vMesg, vMType, NULL);
END;
Error starting at line : 1 in command -
DECLARE
vSender VARCHAR2(30) := 'gajananrao.patwari@tcs.com';
vRecip  VARCHAR2(30) := 'gajananrao.patwari@tcs.com';
vSubj  VARCHAR2(50) := 'hi';
vMesg  VARCHAR2(4000) := 'test';
vMType  VARCHAR2(300) := 'text/plain; charset=us-ascii';
BEGIN
utl_mail.send (vSender, vRecip, NULL, NULL, vSubj, vMesg, vMType, NULL);
END;
Error report -
ORA-06550: line 8, column 1:
PLS-00201: identifier 'UTL_MAIL' must be declared
ORA-06550: line 8, column 1:
PL/SQL: Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:
Re: PLS-00201: identifier 'UTL_MAIL' must be declared [message #664151 is a reply to message #664150] Wed, 05 July 2017 06:31 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Have you created the utl_mail package? If not, you need to run utlmail.sql and prvtmail.plb
This is all detailed in the docs.
Re: PLS-00201: identifier 'UTL_MAIL' must be declared [message #664154 is a reply to message #664150] Wed, 05 July 2017 07:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

All what you need to set is detailed in the article you gave, did you do every step?

Re: PLS-00201: identifier 'UTL_MAIL' must be declared [message #664161 is a reply to message #664154] Wed, 05 July 2017 14:05 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
also the creation of the utl_mail package MUST be done as the SYS user logged in with the SYSDBA privilege. You will also need to specify the IP/DNS address of the SMTP server that you are attaching to. It is all described in the documentation on installing the UTL_MAIL package
Re: PLS-00201: identifier 'UTL_MAIL' must be declared [message #664651 is a reply to message #664161] Wed, 26 July 2017 06:38 Go to previous messageGo to next message
grpatwari
Messages: 288
Registered: June 2008
Location: Hyderabad
Senior Member
Thank you.

I have created utl_mail packages and able to send mails.
Re: PLS-00201: identifier 'UTL_MAIL' must be declared [message #664663 is a reply to message #664651] Wed, 26 July 2017 08:32 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Wonderful. Glad it worked out for you
Previous Topic: How to find out Last Modification Time of a database?
Next Topic: String manipulation
Goto Forum:
  


Current Time: Fri Mar 29 08:13:29 CDT 2024