Oracle Certification, Database Administration, SQL, Application, Programming Reference Books
E-mailing Report Output to User (Method 1)

We can  send alerts and reports  to users via email by configuring a printer to call an operating  system  script to send email.  Following is the procedure.

1. Define two printer styles (portrait and landscape).

2. Define a printer driver to call your os script.
In the arguments field enter the syntax  for calling an operating system script for your environment with the parameters for filename, username and title (subject).
UNIX: $CUSTOM_TOP/bin/email.sh $PROFILES$.FILENAME
     $PROFILES$.USERNAME $PROFILES$.TITLE

3. Assign printer   to the two print styles and  the driver

4. Register the  printer called email_p.

5. Default your report or alert to use the email printer as a shell script.

Sample Unix script email.sh

#!/bin/ksh
email_addr=$2@hotmail.com
mailx –s “$3” $email_addr < $1
exit 0

$1 is The FileName.
$2 is The E-mail Address.
$3 is Subject/Title of Mail.

Return to : Oracle Database, SQL, Application, Programming Tips