Skip to main content
17-Peridot
December 17, 2021
Solved

SQL Union all Statement with Thingworx SQL

  • December 17, 2021
  • 1 reply
  • 2018 views

I am trying to execute following SQL query statement in MSSQL with Thingworx.

 

SELECT [C1] FROM [Table 1]
UNION ALL
SELECT [C1] FROM [Table 2];

 

Getting following issue,

Execute Query failed: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'allselect'.

 

But its working without "ALL"

Best answer by VladimirN

 Hi,

 

There is an article - "Line breaks in SQL Service (Database Thing) are not properly handled in ThingWorx 9.1.0": https://www.ptc.com/en/support/article/CS334683 

1 reply

VladimirN24-Ruby IIIAnswer
24-Ruby III
December 17, 2021

 Hi,

 

There is an article - "Line breaks in SQL Service (Database Thing) are not properly handled in ThingWorx 9.1.0": https://www.ptc.com/en/support/article/CS334683 

17-Peridot
December 20, 2021

Thanks for your support.

Its working as following,

SELECT [C1] FROM [Table 1]
UNION ALL SELECT [C1] FROM [Table 2];