Skip to main content
March 28, 2023
Question

Issues with Export SQL To Excel Smart Service

  • March 28, 2023
  • 2 replies
  • 1 view

We are trying to get an excel document from a SQL Query and we are getting the following error: 

Export SQL To Excel An error occurred in executing an Activity Class.


We tried to rewrite the SQL sentences using quotes but it keeps failing the same way.

SQL Sentence: 

SELECT
`ORDER_BY` AS `EMPLEADO`,
`PLATO`,
`IS_PAN` AS `PAN`
FROM
`SL_ORDERS`
INNER JOIN `SL_LUNCH` ON `SL_ORDERS`.`LUNCH_ID`=`SL_LUNCH`.`ID`
WHERE
`SL_ORDERS`.`ID` IN ('1', '2')
AND `SL_ORDERS`.`DIA_SEMANA`='1'

We know the problem is from the SQL sentence because if we put a typical Select * table without anything else works, so everything else is fine in the input section.




2 replies

March 28, 2023

You will have to wrap the sql in quotes only to pass it into the Sql node input. Is the script working on DB side? although it looks fine to me.

What is your data source? can you try to run it after removing backtick (`) everywhere from the query.
I have personally used this smart service with MariaDB, MSSQL and Oracle as a data source and they all worked as expected.

March 29, 2023

I found a blank space at the start of some the data in one of the columns in the database. So I already fixed it using trim(data) but thanks for replaying.