1

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.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786
user3146332
  • 51
  • 3
  • 12
  • Are you asking how to send an e-mail from a database? Are you asking for Oracle or MySQL??? After e-mailing you need to learn about scheduling... thinking about it this is massively broad but there's plenty of information in the documentation of which ever RDBMS you're actually using to help. – Ben May 17 '14 at 14:10
  • oracle JOBS and SMTP - there is a ton of documentation. – Randy May 17 '14 at 14:22
  • Yes this is very possible but not with plain SQL. Tools to look for: Oracle [PL/SQL](http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/toc.htm), [UTL_SMTP](http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/u_smtp.htm) and [DBMS_SCHEDULER](http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sched.htm). In fact I recently implemented a configurable (domain specific) email notifier :) – user272735 May 17 '14 at 15:04

1 Answers1

0

You can follow the following steps to configure sending email (results of query) in Oracle Database:

Community
  • 1
  • 1
Suresh Gautam
  • 816
  • 8
  • 21
  • 1
    Good advice, I'd only add one point: Since the OP is using 11g, he'll also need to configure Oracle's own ACLs to allow connections to the mail server to avoid the famous ORA-24247 – Frank Schmitt May 19 '14 at 06:43