Jump to content
We've recently updated our Privacy Statement, available here ×

query dynamic. is it possible?


2006 IR Open Dicussion

Recommended Posts

By: laz - lazzeronis

query dynamic. is it possible?

2006-07-04 00:25

hello I seek has to provide has my report his query while passing it by parameter because this query is dynamic. how can one make?

 

 

 

 

 

By: David Karnowski - karnowski

RE: query dynamic. is it possible?

2006-07-06 09:16

Yes, you'll have to use the "!" in the parameters of your query for the dynamic sections. For example:

 

select *

from $P!{tableName}

where $P!{columnName} = $P{columnValue}

order by $P!{orderBy}

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

I think it impossible.

 

I can not passed values for parameter in query.

Ex:

Report query:

 

SELECT *

FROM Employee

WHERE

EmpName = $P!{P_ID}

 

P_ID data type: String

 

 

And the trouble with me:

 

 

How can I passing values to P_ID parameter

 

from java alpplication ???

 

ex: P_ID = '6' ==> passing how?

 

I want to result:

 

SELECT *

FROM Employee

WHERE

EmpName = '6'

 

EMAIL: cxtapt@yahoo.co.uk

Post edited by: cxtapt, at: 2006/09/30 03:42

Link to comment
Share on other sites

as posted by David Karnowski, that method can actually work but your problems seems to be on the java application side where you're unsure how to pass the parameter. to pass parameter from java app into jasper/ireport, pass it as hashmap. define a key say "P_ID", and pass the whole intended parameter required; (in your case the string). From iReport retrieve it using the "P_ID" key, cast it as String object and concatenate it into your query.
Link to comment
Share on other sites

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