Skip to main content
Dec 17, 2021 12:56 PM UTC
Solved

SQL Union all Statement with Thingworx SQL

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"

VladimirNAnswer
Dec 17, 2021 1:44 PM UTC

 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 

2 replies

VladimirNAnswer
Dec 17, 2021 1:44 PM UTC

 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 

Dec 20, 2021 5:23 AM UTC

Thanks for your support.

Its working as following,

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