Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Übergeben von SQL-Operatoren zur Abfrage über iReport-Parameter

Versuchen Sie, Folgendes in Abfragen zu verwenden:
select ... from table1 where transaction_amount $P!{paramReport}

Aus JasperReports Ultimate Guide:

$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>