SQL/PL SQL - Count rows from table and send email if count > 0
I am running 11.1.0.7 on a Windows platform. I want to have a SQL/PL SQL job I can schedule that will go out and look through a table and if it finds any rows with a status of 'ERROR' then send an email out.
I have the SQL that will select (*) from <table> where STATUSSTRING = 'ERROR', how do I get it to then send an email out? I do have an SMTP server accessible to the server on which this script will run.
Thanks in advance for your help.