title: Stored Procedure with optional "WHERE" parameters
body: <p>I have a form where users can specify various parameters to dig through some data (status, date etc.).</p>
  
  <p>I can produce a query that is:</p>
  
  <pre><code>SELECT * FROM table WHERE:
  status_id = 3
  date = &lt;some date&gt;
  other_parameter = &lt;value&gt;
  </code></pre>
  
  <p>etc. Each <code>WHERE</code> is optional (I can select all the rows with <code>status = 3</code>, or all the rows with <code>date = 10/10/1980</code>, or all the rows with <code>status = 3 AND date = 10/10/1980</code> etc.).</p>
  
  <p>Given a large number of parameters, all optional, what is the best way to make up a dynamic stored procedure?</p>
  
  <p>I'm working on various DB, such as:
  MySQL, Oracle and SQLServer.</p>