Pentaho

 View Only

 CDE: Problems with sql over sqljndi

  • Pentaho
  • Ctools
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
Roberto Romero's profile image
Roberto Romero posted 10-06-2020 12:35

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,


#Kettle
#Ctools
#Pentaho
#PentahoDataIntegrationPDI
Luciano Donazzolo's profile image
Luciano Donazzolo

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

Roberto Romero's profile image
Roberto Romero

Thanks for your help. We will test as you indicate, with parameters.