title: using alias with type in oracle sql rising ORA-00907: missing right parenthesis error
body: <p>I have following code:</p>
  <pre><code>select a.DATA_ID, 
      b.FILE_NAME, b.CREATION_DATE, 
      CASE  WHEN a.cdvs_data is null THEN 'N' ELSE 'Y' END AS IS_DELETABLE from cl_dat_dst_his c inner join CL_DAT_VERSION a on c.CL_DAT_VERSION_ID=a.CL_DAT_VERSION_ID
      inner join cl_history b on c.CDVS_HIST_ID = b.CL_HIS_ID  where b.CL_HIS_TABLE_ID=14424 ORDER BY b.CREATION_DATE DESC
  </code></pre>
  <p>However, when i wrap the result inside the TYPE as following:</p>
  <pre><code>select uploaded_data(a.DATA_ID, 
          b.FILE_NAME, b.CREATION_DATE, 
          CASE  WHEN a.cdvs_data is null THEN 'N' ELSE 'Y' END AS IS_DELETABLE) from cl_dat_dst_his c inner join CL_DAT_VERSION a on c.CL_DAT_VERSION_ID=a.CL_DAT_VERSION_ID
          inner join cl_history b on c.CDVS_HIST_ID = b.CL_HIS_ID  where b.CL_HIS_TABLE_ID=14424 ORDER BY b.CREATION_DATE DESC
  </code></pre>
  <p>It is showing following error:</p>
  <blockquote>
  <p>ORA-00907: missing right parenthesis</p>
  </blockquote>
  <p>could you give me hint what is the problem?</p>