title: Groovy Eval function to evaluate some part of sql query
body: <p>I have to use groovy Eval() on a sqlquery and get it evaluated at runtime.
  I am using like </p>
  
  <pre><code>query =groovy.util.Eval.x(sqlQuery,sqlQuery); and 
  sqlQuery =select Distinct &lt;col1&gt; from Tablename where criteira1=&lt;cond&gt; AND Clas1.getDateonDBType(fieldname) 
  </code></pre>
  
  <p>I have to evaluate Clas1.getDateonDBType(fieldname) which is a java method at runtime as this depends on DB i am connected to . Eval function is able to fetch the sqlQuery but throwing exception like </p>
  
  <pre><code>Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  Script1.groovy: 1: unexpected token: DISTINCT @ line 1, column 8.
  </code></pre>
  
  <p>I am new to groovy .Please help me to find what is wrong</p>