Browndog Posted February 26, 2008 Share Posted February 26, 2008 How do I use values from REPORT_PARAMETERS_MAP SQL in an sql query? This is what I want to do: <queryString> <![CDATA[sELECT * FROM shiftReport WHERE shiftDate = $P{REPORT_PARAMETERS_MAP}.get("startDate") ]]></queryString> Is there a way this can be done? I tried to assign a variable to this value then put the varible in the query, but it seems to me that the query is being run before the variable has been assigned. Link to comment Share on other sites More sharing options...
lucianc Posted February 26, 2008 Share Posted February 26, 2008 If you define a parameter named "startDate", you could directly use its value in the query. Or you could define a parameter and explicitly sets its default value to $P{REPORT_PARAMETERS_MAP}.get("startDate"). HTH,Lucian Link to comment Share on other sites More sharing options...
Browndog Posted February 27, 2008 Author Share Posted February 27, 2008 Yeah I tried that but it seems it runs the query before it assigns the default value to the parameter. I'm now running the query in my swing app and passing on the resultset. The only disadvantage I can see in this is; I'm using netbeans plugin and I can't use the preview with this method. But otherwise I'm happy :). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now