Reputation: 3799
can anyone help me in wiring a shell script to acess sqlplus . In sqlplus i need to run a sql script and mail the result back to a mail id.
example
ls dir ----> has abc.sql
i go to sqlplus and run query by ==> **sqlplus username/password@instance @abc**
I want to mail the result to [email protected]
Upvotes: 1
Views: 1651
Reputation: 3967
You shuld redirect the output of sqlplus to a file And then use mailx to send that to specified email id.
Upvotes: 0
Reputation: 360315
You should be able to do:
sqlplus username/password@instance @abc | mail -s "Email Subject" [email protected]
Upvotes: 3