title: How to write a report script in Oracle
body: <p>My knowledge on SQL and Oracle does not go beyond querying I'm afraid, but what I'm looking to do is run some kind of script which will produce multiple reports from one execution. I have a whole bunch of code and at the moment I'm rerunning it about 30 times, each time replacing the following in the WHERE clause with a different "SUBJECT_ID":</p>
  
  <pre><code>SELECT ...
  FROM ...
  WHERE ...
  AND (v.SUBJECT_ID LIKE 'B%')
  ...
  </code></pre>
  
  <p>I'm thinking I should be able to run some kind of loop script and output all the 30 reports in one go...? I am hoping to get some kind of training on this quite soon, but any help would be greatly appreciated!</p>