title: Reusing parameters more than once
body: <p>I am writing a report in BIRT. I have two input parameters on my data set.</p>
  
  <p>The second parameter I would like to use twice in my <strong>where</strong> clause. I found I cam do this using a <strong>with</strong> clause. Note this is a postgresql database so I do not need <strong>from dual</strong>.</p>
  
  <p>My sql is as follows:</p>
  
  <pre><code>with "params" as (select ? as "sname", ? as "ename")
  select "user"."fullName", "user"."address1", "user"."address2", "user"."city", "provinces"."abbreviation", "user"."postalcode", "client"."companyName"
  from "user", "params"
  LEFT JOIN "client" on "user"."client" = "client"."id" 
  LEFT JOIN "provinces" on "user"."province" = "provinces"."id"
  WHERE "user"."fullName" &gt;= "params"."sname" and (("user"."fullName" &lt;= "params"."ename") or ("params"."ename" =''))`
  </code></pre>
  
  <p>When I try to run this or preview the results in BIRT's edit data set screen I get the following error:</p>
  
  <blockquote>
    <p>Error happened while running the report.
        at ....
    Caused by: org.eclipse.birt.report.data.adapter.api.AdapterException: An exception occurred during processing. Please see the following message for details:
    Failed to prepare the query execution for the data set: user
    Cannot get the result set metadata.
        org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
    SQL error #1:ERROR: invalid reference to FROM-clause entry for table "user"
      Hint: There is an entry for table "user", but it cannot be referenced from this part of the query.
      Position: 252;</p>
  </blockquote>
  
  <p>I can't get by this. From everything I have seen it should work.</p>