Solved

about UTL_mail

Posted on 2007-11-26
4
2,746 Views
Last Modified: 2013-12-19
I am trying to develop plsql code to generate automatic email to send as a reminder.I followed the procedure which was stated in the UTL_MAIL in the metalink about the UTL_MAIL.. But iam getting an error message.
I configured the spfile with the servername and port like

alter system set smtp_out_server = 'mail.xxxx.com :25' scope = spfile.

I tried scope=both ; but that dint work so i kept as spfile
and later
create pfile from spfile.


the error is
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.SEND_EMAIL_TEST102 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

but the procedure was complied properly and no errors were displayed



@d:\oracle\infra\rdbms\admin\utlmail.sql;
 

@d:\oracle\infra\rdbms\admin\prvtmail.plb;
 

---both were successfully created and i restarted the database before after configuring the spfile 
 

CREATE OR REPLACE PROCEDURE send_email_test102

   BEGIN  

     UTL_MAIL.SEND(sender => 'kxxxx@richards.com', recipients => 'soxxxxn@richards.com', cc => 'sxxxx@richards.com', bcc => 'sxxxx@richards.com', subject => 'Testmail', message => 'Hello');

   EXCEPTION

   WHEN OTHERS THEN

    --  dbms_output.put_line('Fehler');

     raise_application_error(-20001,'The following error has occured: ' || sqlerrm);   

   END;
 
 

exec send_email_test102;
 

here is the pfile

INITinfra.ORA  = pfile

*.aq_tm_processes=1

*.background_dump_dest='D:\Oracle\admin\infra\bdump'

*.compatible='10.1.0.2.0'

*.control_files='D:\Oracle\oradata\infra\CONTROL01.CTL','D:\Oracle\oradata\infra\CONTROL02.CTL','D:\Oracle\oradata\infra\CONTROL03.CTL'

*.core_dump_dest='D:\Oracle\admin\infra\cdump'

*.db_block_size=8192

*.db_cache_size=50331648

*.db_domain='richards.com'

*.db_file_multiblock_read_count=16

*.db_name='infra'

*.db_recovery_file_dest='D:\Oracle\flash_recovery_area'

*.db_recovery_file_dest_size=2147483648

*.dispatchers='(PROTOCOL=TCP)(PRE=oracle.aurora.server.GiopServer)','(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)'

*.java_pool_size=67108864

*.job_queue_processes=5

*.large_pool_size=8388608

*.max_commit_propagation_delay=0

*.open_cursors=300

*.pga_aggregate_target=33554432

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.sessions=400

*.shared_pool_size=150994944

*.smtp_out_server='mail.richards.com :25','smtp.richards.com :25','mail.richards.com :','smtp.richards.com :2500'

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS'

*.user_dump_dest='D:\Oracle\admin\infra\udump'
 

and also executed utl_smtp just in case
 

@D:\Oracle\infra\rdbms\ADMIN\utlsmtp.sql
 

and everything was in sys as username

Open in new window

0
Comment
Question by:tbksandeep
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 20355791
CREATE OR REPLACE PROCEDURE send_email_test102
   BEGIN  
     UTL_MAIL.SEND(sender => 'kxxxx@richards.com', recipients => 'soxxxxn@richards.com', cc => 'sxxxx@richards.com', bcc => 'sxxxx@richards.com', subject => 'Testmail', message => 'Hello');
   EXCEPTION
   WHEN OTHERS THEN
    --  dbms_output.put_line('Fehler');
     raise_application_error(-20001,'The following error has occured: ' || sqlerrm);  
   END;
/   ---> we should have a / here to first execute this statement which creates the procedure. I am not sure whether you have missed this while pasting your code or your actual code itself does not have this.

Run the above and retry.

Thanks
0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 500 total points
ID: 20355794
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.SEND_EMAIL_TEST102 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

The above means the SYS.SEND_EMAIL_TEST102 is invalid. If you create/compile it properly, then it will be valid and you should be able to execute it without issues.

if you want to check its status,

select owner, object_name, object_type, status
from dba_objects
where object_name ='SEND_EMAIL_TEST102 ';

The status should be valid in the above query output.

Thanks
0
 

Author Closing Comment

by:tbksandeep
ID: 31411132
thanks for the solution which you gave me
0
 

Author Comment

by:tbksandeep
ID: 20358646
nav_kum_v:

thanks for the reply what you posted for checking the status but its not working. so is there someother way to check the status of the procedure

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now