DA SQL UNION

I have two tables with the following SELECT statements:

SELECT [CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [BTEK2].[dbo].[RASearchManufacturing]
WHERE
{WHERE}

and:

SELECT [CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [BTEK2].[dbo].[RASearchSalesOrders]
WHERE
{WHERE}

If I execute either of these two DA SQL queries they work individually:

SELECT [CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [RASearchSalesOrders] WHERE SERLTNUM LIKE :SERIALNO

and:

SELECT[CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [RASearchManufacturing] WHERE SERLTNUM LIKE :SERIALNO

I am then able to display the results in a grid control.

If I try to do a union of these two statements as shown below then I get an exception.

SELECT [CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [RASearchSalesOrders] WHERE SERLTNUM LIKE :SERIALNO
UNION SELECT[CUSTNMBR],[ITEMNMBR],[SOPNUMBE],[GLPOSTDT],[SERLTNUM],[ORIGNUMB],[CSTPONBR],[ITMSHNAM] FROM [RASearchManufacturing] WHERE SERLTNUM LIKE :SERIALNO

image

UNION / UNION ALL is not supported by DA SQL atm.

I’ll log an issue to investigate this. You’ll be auto-notified on issue progress via messages in this thread.

Thanks, logged as bugs://82031

Ok

I’ve set up a new “table” and put that SQL UNION into the command then used DA SQL to select from that table

Yes, that’s a workaround. I still need to investigate if it is possible to implement the UNION / UNION ALL support directly on the DA SQL level.

bugs://82031 got closed with status fixed.