beekerc69 Posted December 27, 2015 Share Posted December 27, 2015 I'm converting several reports from Crystal to Jaspersoft that have SQL queries that us the With/As clause before the acutal Select statement is encountered.While this seems to work in Jaspersoft Studio - meaning i can see the report in Preview mode, it appears that JasperServer doesn't like it. i get a 6632 error.in one case, i was able to move the With/As clause queries down into the From/Join section and make it work, but i know there will be queries where i won't be able to do that.is there a way to get JasperServer to work with the With/As clause? Link to comment Share on other sites More sharing options...
zh3ntil Posted December 28, 2015 Share Posted December 28, 2015 You are getting this error because of security validator. Security validator let you start a query with 'Select' only. You could set the SQL validation off or add 'WITH' to validator.1. Set SQL validation off WEB-INFclassesesapisecurity-config.properties security.validation.sql.on=false 2. Adding WITH to the security validator Open jasperserver-pro/WEB-INF/classes/esapi/validation.properties Add the following to the ValidSQL rule: Validator.ValidSQL=(?is)^\s*(select|with)\s+^;+$ Close the file and restart the server. The ValidSQL rule will now allow for the words "select" or "with" to be at the beginning of a query. I recommend you to use second one. Because disabling the validator causes lack of security. Link to comment Share on other sites More sharing options...
beekerc69 Posted January 29, 2016 Author Share Posted January 29, 2016 based on the replies and some other research, i've got one more option. Select * from (with xyz as (select.....)select fromwhere ) in this form, you can still use with/as constructs but it complies with the rule that word SELECT must be first .this would be useful when changing the server SQL validation is not an option. Link to comment Share on other sites More sharing options...
ruthran Posted February 22, 2017 Share Posted February 22, 2017 Hi, One of my report uses query that has "WITH" clause in it. Though the query runs just fine in SQL tools, it is throwing error in SQL editor of Jasper studio. Is there any settings in Jasper studio that we can change to avoid this error.? 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