'Is there any way to mail the Output of a SELECT query to a pre-defined list of email ids in Oracle?
Everyday at my job, i need to fetch results of these queries and send them one by one to these recipients.This is so much time consuming.
What i want to do,is to automate this process.
I want help in coding a script that will automatically mail the results of these queries to the recipients, at a particular time of the day. Is it possible? If Yes, then How?
Any kind of help will be appreciated.
Solution 1:[1]
You can follow the following steps to configure sending email (results of query) in Oracle Database:
Create owner_schema.sp_send_email stored procedures. Please Refer following links to get PL/SQL scripts for sending email. You need to configure sender, recipients, email server host and email server listening port. You also make sure that you have added oracle server on the ACL list of email server, verify using user@source_oracle_database server $ telnet email_server port.
http://www.dba-oracle.com/t_utl_smtp_utility.htm
http://www.ryanboyer.net/e-mail-query-results-from-orac/
How to sent email in Oracle PL/SQL package to multiple receivers?
Create a Oracle Scheduler if you need to send email regularly(hourly, daily, weekly, monthly, yearly...) and configure scheduler to execute email sending procedure as per the requirements.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
