From oracle-l-bounce@freelists.org  Wed Oct 27 11:17:03 2004
Return-Path: <oracle-l-bounce@freelists.org>
Received: from air189.startdedicated.com (root@localhost)
 by orafaq.com (8.11.6/8.11.6) with ESMTP id i9RGH3J23178
 for <oracle-l@orafaq.com>; Wed, 27 Oct 2004 11:17:03 -0500
X-ClientAddr: 206.53.239.180
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i9RGH2I23165
 for <oracle-l@orafaq.com>; Wed, 27 Oct 2004 11:17:03 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP
 id 798AF72FC5A; Wed, 27 Oct 2004 11:23:14 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
 id 05623-10; Wed, 27 Oct 2004 11:23:14 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP
 id E080172CBED; Wed, 27 Oct 2004 11:23:13 -0500 (EST)
Message-ID: <6BA0194B4809D9118361000F1F6C9510017E1B33@exchmn4.lifetouch.com>
From: DENNIS WILLIAMS <DWILLIAMS@LIFETOUCH.COM>
To: oracle-l@freelists.org
Subject: RE: Emailing Query Results?
Date: Wed, 27 Oct 2004 11:20:34 -0500
MIME-Version: 1.0
Content-type: text/plain
Content-Transfer-Encoding: 8bit
X-archive-position: 11591
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-To: oracle-l-bounce@freelists.org
X-original-sender: DWILLIAMS@LIFETOUCH.COM
Precedence: normal
Reply-To: DWILLIAMS@LIFETOUCH.COM
X-list: oracle-l
X-Virus-Scanned: by amavisd-new at freelists.org

Here is an article on how to do it within Oracle. I think someone on this
list has this working. Has anyone got this working on W2K?

http://www.databasejournal.com/features/oracle/article.php/1496631 

Dennis Williams
DBA
Lifetouch, Inc.

-----Original Message-----
From: DENNIS WILLIAMS 
Sent: Wednesday, October 27, 2004 11:18 AM
To: oracle-l@freelists.org
Subject: RE: Emailing Query Results?


Michael
   You didn't mention the platform. I can't answer for Oracle jobs. On Unix,
I do have a korn shell script executed by cron that fires up sqlplus, runs a
query, sends the output to a file, then exits sqlplus and emails the file.

Dennis Williams
DBA
Lifetouch, Inc.

-----Original Message-----
From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org]
On Behalf Of Michael Cupp, Jr.
Sent: Wednesday, October 27, 2004 10:11 AM
To: Oracle-L
Subject: Emailing Query Results?

I would like to create a query that runs nightly (maybe a procedure, kicked
off from oracle jobs?) that runs a query, and if the query results in rows
returned, then to have it email to a specified email account(s).  Think
exception list - for example, select customer_no, customer_name, city, state
from customers where customer_zip_code is null or length(customer_zip_code)
not in (5,10); - This way we can tackle nightly issues that arrise before
they become a large issue.  (I KNOW I KNOW - require the field - Our
specific example isn't based on ZIP CODE, so I can't for other reasons)

Has anyone done this?  Can anyone give me examples?


Thanks,
M

-----
Michael Cupp, Jr.
Perma-Fix Industrial Services
mcupp@perma-fix.com

--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l

