title: How to use different conditions depending on variable value. Pro C / SQL
body: <p>I am quite new to pro c and wanted to know wether the below is possible.</p>
  
  <pre><code>char car[11];
  strcpy(car,""); /* default value*/
  </code></pre>
  
  <p>if this variable has a value it should be used within the sql below :
  So run for given car value only.</p>
  
  <pre><code>select *
  from vehicles
  where car = :car;
  </code></pre>
  
  <p>However if car is null then do the following sql:
  So run for all cars.</p>
  
  <pre><code>select *
  from vehicles;
  </code></pre>
  
  <p>Is there a way to merge these two without needing to create duplicate sql queries where ones searches for a given car value and another for all cars.</p>
  
  <p>Any Help would be appreciated.</p>