forever.sumitsharma Posted July 23, 2015 Share Posted July 23, 2015 I need to write the recursive query to fetch the data in my select query.but it was giving me error with that. I'm writing this queryWITH RECURSIVE all_reports AS ( SELECT id, manager_user_id, user_group_id FROM users WHERE manager_user_id=4 UNION ALL SELECT c.id, c.manager_user_id, c.user_group_id FROM all_reports ar, users c WHERE c.manager_user_id=ar.id ) is it possible to write the recursive query? if yes please suggest me what I'm doing wrong. Thanks in advance Link to comment Share on other sites More sharing options...
joel.carlson Posted August 27, 2015 Share Posted August 27, 2015 I only got this working in version 6.1.0. You have to add With to the validation.properties file. By default it only allows select and call. So go to /{yourinstalldirectory}/jasperreports-server-cp-6.1.0/apache-tomcat/webapps/jasperserver/WEB-INF/classes/esapiThere you will find validation.properties file, search for Validator.ValidSQL= and add with where you see select and call. I use linux so I am not sure your platform. I also tried this in version 5.5.0 but couldn't get it to work. It works fine for me in the latest version and I use a lot of CTE queries now to build temp tables in db2 because it is easier that way than declaring temp tables. 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