Hello community.
In CDE I need to show the evolution of results over several months. When I run the query in any editor, I haven't problem, but in CDE, in "sql over sqljndi" the following error appears:
"Caused by: pt.webdetails.cda.dataaccess.QueryException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PREPARE stmt FROM @SQL;
EXECUTE stmt ;"
The query is:
SET @SQL= (SELECT CONCAT("SELECT ANS, ",
(SELECT
GROUP_CONCAT(DISTINCT
CONCAT (
' max(case when AnMesCi = "', AnMesCi,
'" then Cumplimiento else -1 end) "', AnMesCi,
'\"'
)
FROM
pivoteans
), " FROM pivoteans GROUP BY ANS") ) ;
PREPARE stmt FROM @SQL;
EXECUTE stmt ;
DEALLOCATE PREPARE stmt ;
Thanks for your time,
I think you cannot use this syntax, because CDA internally passes your sql to prepared stmt, in order to handle the execution customization through the "Parameters" option in the "Datasources Panel".
Hope this helps
Luciano
Thanks for your help. We will test as you indicate, with parameters.