Jump to content
JasperReports Library 7.0 is now available ×

Passing SQL query parts


2004 IR Help

Recommended Posts

By: Tim Riemann - octoate

Passing SQL query parts

2004-12-02 01:39

Hi all,

I currently have the problem that I have to add filters dynamically into my SQL statement. It should be possible to do this via the $P!{parameter} element, but if I add this into the ReportQuery in iReport it isn't possible to press the "OK" button (Syntax error in SQL query).

Here is an example for that:

 

SELECT u.field1 FROM user u WHERE field0=$P{oe}

AND usergroup_cd=$P{usergroup_cd} AND usergroup_c=$P{usergroup_c}

$P!{additionalSQL}

 

$P!{additionalSQL} can contain an empty String or something like this: "AND time_begin < 1849357389"

 

Any ideas?

 

TIA Tim

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Passing SQL query parts

2004-12-02 08:59

 

Set a default value for the parameter additionalSQL, i.e. "".

 

Giulio

 

 

 

 

By: Tim Riemann - octoate

RE: Passing SQL query parts

2004-12-03 03:56

Thanks a lot, this is exactly what I meant =).

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...