?
Solved

I want to send an email, the output of a simple SQL query in oracle 10g

Posted on 2011-03-04
5
Medium Priority
?
342 Views
Last Modified: 2013-12-19
I want to send an email, the output of a simple SQL query in oracle 10g
0
Comment
Question by:pegahelpdesk1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35036868
simple:
I would use UTL_MAIL:

http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_mail.htm

If the message is larger than 32K, you'll need to use UTL_SMTP.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35036885
0
 

Author Comment

by:pegahelpdesk1
ID: 35036976
I am planning to store the output of a query into a text file, and then send using bmail, I will use task scheduler to initiate the batch file where all the commands would be written, so can you tell me how to store output of a query into a text file?
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 35037024
Not sure why you want to involve the operating system and extra files when you don't need to but OK:

In sqlplus use the SPOOL command.  There are a lot of sqlplus options you can set and you can actually create very nice reports.


The basic commands go like:
spool myFile.txt
select ... from table;
spool off

If you want more detailed advice on how to use sqlplus and create a specific format, ask.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Suggested Courses

752 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