title: Case statement in Pervasive 8
body: <p>I want to use a case statement in Pervasive as it lacks support for Coalesce as well. But it seems like Pervasive 8 also lacks support for Case statements. </p>
  
  <p>So i wanted to check if there is an alternate solution to my problem.</p>
  
  <pre><code>SELECT top 100 
  STOCKTR.PHEADPR,
  '' as tom
  ,case Pheadpr.BLNO when &lt;&gt; '' then Pheadpr.BLNO else STOCKTR.PHEADPR end as BLNO
  ,Pheadpr.custno
  ,Pheadpr.cust_name
  ,Pheadpr.company_name
  ,Pheadpr.company_city
  ,Pheadpr.invno
  ,Pheadpr.curr_code
  ,STOCKTR.RECID
  ,STOCKTR.ARTNO
  ,STOCKTR.DATE
  ,STOCKTR.QTY_PCS
  ,STOCKTR.PRICE_SEK_PCS
  ,STOCKTR.ULAND  
  FROM STOCKTR INNER JOIN PHEADPR
  ON PHEADPR.NO = STOCKTR.PHEADPR
  WHERE STOCKTR.TRCODE='02' AND STOCKTR.PHEADPR &lt;&gt; '0'
  order by STOCKTR.DATE desc
  </code></pre>
  
  <p>So my question is focused on the fourth row in my select statement that says</p>
  
  <pre><code>case Pheadpr.BLNO when &lt;&gt; '' then Pheadpr.BLNO else STOCKTR.PHEADPR end as BLNO
  </code></pre>
  
  <p>And i want this to result in 1 column output. Is there a way around this in pervasive 8 so that i can get the case-like behavior from my query?</p>
  
  <p>As a sidenote i am using the JDBC driver and doing the query from a Java program.</p>