title: DB2 SQL - Set variable value based on user input
body: <p>In DB2-LUW SQL, I can write a query to do this:</p>
  
  <pre><code>select * from customers
  &amp;input
  </code></pre>
  
  <p>When a user runs that they'll be prompted for input and can type:</p>
  
  <pre><code>where name = 'Bill'
  </code></pre>
  
  <p>And the query that actually gets executed will be:</p>
  
  <pre><code>select * from customers
  where name = 'Bill'
  </code></pre>
  
  <p>I am trying to figure out a way to vary the value of <code>&amp;input</code> to alter the query based on more basic user input - so they won't need to type in <code>where name = 'Bill'</code>.  </p>
  
  <p>For example, the user could be prompted to enter either <code>YesBill</code> or <code>NoBill</code> and depending on what they've entered, the value of <code>&amp;input</code> will be set and the executed query would be either:</p>
  
  <pre><code>select * from customers
  where name = 'Bill'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>select * from customers
  where name &lt;&gt; 'Bill'
  </code></pre>
  
  <p>The example is meaningless, I'm mostly wondering if it's possible to vary the value  of <code>&amp;input</code> without forcing the user to type in SQL code.</p>
  
  <p>Hope that makes sense.  Thanks for any help!</p>