title: Using case inside where clause
body: <p>I´m trying to create a procedure that has a parameter called m_reaplicacao. This parameter receives the values 'S' for Yes, 'N' for No and 'T' for all records. 
  When the parameter is Yes, I should return the records with value equals to 9. 
  When the parameter is No, I should return the records different of 9. And finally, when the the value is All, I should return all records from the table.
  With the code bellow, Oracle says: 
  Compilation errors for PROCEDURE MYDB.CONTAS_A_PAGAR_SPS
  Error: PL/SQL: ORA-00905: missing keyword
  Line: 84
  Text: ta.id_1a_cbr = 9;<br/></p>
  
  <pre><code>    select * from proposta ta
      where 
            ta.estado = 'RJ'
            and case
                 when m_reaplicacao = 'S' then
                      ta.id_1a_cbr = 9;
                 when m_reaplicacao = 'N' then
                      ta.id_1a_cbr &lt;&gt; 9
                 else null
            end case; 
  </code></pre>
  
  <p>I saw a lot of posts, but I did not solve this one.
  Can someone help me, please?</p>