Jump to content
JasperReports Library 7.0 is now available ×

How to set/change query dinamicaly?


Recommended Posts

By: syncat - syncat

How to set/change query dinamicaly?

2005-02-04 01:27

a simple query:

 

SELECT person_id, person_name

FROM Person

ORDER BY person_name

 

I want to pass there some couple of id from app so the query should look like

 

SELECT person_id, person_name

FROM Person

WHERE person_id=12

OR person_id=3

ORDER BY person_name

 

 

By: Goh S H - shgoh

RE: How to set/change query dinamicaly?

2005-02-04 03:44

Read this: http://jasperreports.sourceforge.net/tutorial/index.html

 

"""

2. Sometimes 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 a case, the syntax differs a little, like in the following example:

 

SELECT * FROM Orders ORDER BY $P!{OrderByClause}

"""

 

 

By: syncat - syncat

RE: How to set/change query dinamicaly?

2005-02-07 08:04

And if I do not know how much times it should appear?

One time i will need

 

WHERE person_id=12

OR person_id=3

 

and the other

 

WHERE person_id=12

OR person_id=3

OR person_id=74

OR person_id=9

...

 

How can I do that?

 

 

 

By: syncat - syncat

[sOLVED]

2005-02-07 08:44

Oh, i get right now it. Thanks for your previous post :)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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