Using the following in a Select clause causes a SQL Validation error:
CASE WHEN (P.InvalidEmail = 0) AND (W.InvalidEmailAddress1 = 0) AND (LTRIM(RTRIM(W.EmailAddress)) != '' ) AND (LTRIM(RTRIM(W.EmailAddress1)) != '') THEN ';' ELSE '' END AS Email,
Changing the ";" to a "-" so that the line reads
CASE WHEN (P.InvalidEmail = 0) AND (W.InvalidEmailAddress1 = 0) AND (LTRIM(RTRIM(W.EmailAddress)) != '' ) AND (LTRIM(RTRIM(W.EmailAddress1)) != '') THEN '-' ELSE '' END AS Email,
runs without error. The (anomonised) error is:
2018-06-04 14:48:11,382 ERROR Validator,***-Replen subreports #1:496 - Invalid SQL:An error has occurred. Please contact your system administrator. (6632), SQL: SELECT ....
....
2018-06-04 14:48:11,382 ERROR JRFillSubreport,pool-4-thread-67:879 - Fill 1: exception
com.jaspersoft.jasperserver.api.JSSecurityException: An error has occurred. Please contact your system administrator. (6632)
Arguments:
at com.jaspersoft.jasperserver.api.security.validators.Validator.validateSQL(Validator.java:497)
The error does not occur on 6.4.2
The idea of the code is to generate a semicolon separated list of email addresses for passing to a mail server.
Additional Information: Data source is SQL Server 2012 STD
Please let me know if you require any further information.
Regards
Dale
Recommended Comments