title: Expected CHAR got NUMBER
body: <p>DB: Oracle 11g</p>
  
  <p>Query:</p>
  
  <pre><code>SELECT CASE
        WHEN rs.OPTION = '3'
        THEN
          (SELECT COUNT(DISTINCT ex.EXTS) AS TMPCOL0
          FROM CRSIDM.SUB_OPTS ex
          INNER JOIN CRSIDM.SUB_OPTS_GRP cg
          ON  cg.GROUP_ID   = ex.GRP_ID        
          )
        ELSE
          (SELECT COUNT(DISTINCT ex.EXTS) AS TMPCOL0
          FROM CRSIDM.SUB_OPTS ex
          INNER JOIN CRSIDM.SUB_OPTS_POL cg
          ON  cg.GROUP_ID   = ex.GRP_ID
          )
      END    AS PROPTS
    FROM PR_OPTS
  </code></pre>
  
  <p>I am getting error 'expected CHAR got NUMBER', here EXTS,GROUP_ID &amp; GRP_ID are numeric. Then how there is a chance of expecting CHAR?</p>