Bernie Huang writes:
> My boss wants me to write a script that will send a email report to him
> monthly with the result of database queries.
> I guess a shell script is necessary. So, is it possible to call
> 'psql' and returning its query result and I can use sendmail to email
> the result? Any other idea?
Conceptually, what you want is something like this:
echo "Here's your report:"
psql -c 'SELECT ...'
) | mail -s Subject foo(at)bar
Reading man pages on each of these is advisable.
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/
In response to
pgsql-sql by date
|Next:||From: Jason||Date: 2000-11-27 22:36:40|
|Subject: Re: [PHP-DB] Re: [SQL] a script that queries database periodically|
|Previous:||From: Roberto Mello||Date: 2000-11-27 21:56:59|
|Subject: Re: [SQL] a script that queries database periodically|
pgsql-general by date
|Next:||From: Callis, Adam||Date: 2000-11-27 22:27:25|
|Subject: I got Pl/Perl working on Solaris!|
|Previous:||From: Partyka Robert||Date: 2000-11-27 22:24:46|
|Subject: one ask|