Jump to content
JasperReports Library 7.0 is now available ×

variable in query


ktrinad

Recommended Posts

By: Paul Stanton - wanto

variable in query

2004-04-26 15:48

i would like to use a variable in my query which is based on a parameter. jasper does not seem to evaluate the variable, instead sends the variable name '$V{XX}' down to the db engine. is this standard behaviour? if so, it's a little limiting. any one come across this before or had variables work in their queries?

 

 

By: Richard Laplante - rlaplante

RE: variable in query

2004-12-02 12:44

Hi,

 

I think a came across a similar problem and I searched a lot before finding the solution which was quite simple.

 

It works for parameter, it might work for Variable.

 

you have to use "!" after your parameter/variable marker.

 

example:SELECT id, name FROM table WHERE id = $P!{itemid}

 

or

 

SELECT id, name FROM adservingactivity WHERE id = $V!{activityid}

 

Hope that will work

(I don't have time now to test myself)

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