Oracle
 sql >> Database >  >> RDS >> Oracle

Passaggio di operatori SQL per eseguire query tramite il parametro iReport

Prova a utilizzare in questo modo nella query:
select ... dalla tabella1 dove transaction_amount $P!{paramReport}

Dalla guida definitiva di JasperReports:

$P{paramName} Syntax
The parameters are used like normal java.sql.PreparedStatement parameters, using
the following syntax:
<queryString>
<![CDATA[
SELECT * FROM Orders WHERE OrderID <= $P{MaxOrderID} ORDER BY
ShipCountry
]]>
</queryString>

$P!{paramName} Syntax
Sometimes it is useful to use parameters to dynamically modify portions of the SQL
query or to pass the entire SQL query as a parameter to the report-filling routines. In
such cases, the syntax differs a little, as shown in the following example. Notice the !
character:
<queryString>
<![CDATA[
SELECT * FROM $P!{MyTable} ORDER BY $P!{OrderByClause}
]]>
</queryString>