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

Sender SQL-operatorer til at forespørge gennem iReport-parameter

Prøv at bruge sådan her i forespørgslen:
vælg ... fra tabel1 hvor transaktionsbeløb $P!{paramReport}

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


  1. Hvordan implementerer man gapless, brugervenlige ID'er i NHibernate?

  2. Ef kerne 5 mange til mange filter

  3. Få rekord pr. måned, men få også nul, hvis ingen rekorder den måned

  4. Alternativ til LOAD_FILE() funktion?