Hello,
Is the use of Cross/Outer Apply supported in datawindow sql queries?
Im running into a problem, using either 'ODB ODBC' or 'MSQLEDBSQL SQL Server' for my db connection to a sql server 2019 instance.
The problem is when including an apply in my query, the column names in the "Name" and "DB Name" columns of the Column Specification list in the datawindow painter lose the table names. as in they go from being Table.Column or table_column, to just Column. with larger queries, this also causes ambiguous column names to be excluded from the list.
I created an example using the MS AdventureWorks2019 database in PB 2022 R2. The use of apply in this example is to showcase the the the problem with the datawindow painter.
Below are screenshots of the column specification and sql for both example datawindows.
d_withoutapply sql
Select c.AccountNumber, p.lastname, p.firstname
From Person.Person p
Left Join Sales.Customer c on p.BusinessEntityID = c.PersonID
where c.CustomerID is not null
d_withapply sql
Select c.AccountNumber, p.lastname, p.firstname, t.Total
From Person.Person p
Left Join Sales.Customer c on p.BusinessEntityID = c.PersonID
Outer Apply (Select SUM(TotalDue) as Total
From Sales.SalesOrderHeader x
where x.CustomerID = c.CustomerID
Group by CustomerID) t
where c.CustomerID is not null
Thank you for marking this post as "resolved"! :-)
Regards ... Chris
Thank you for the info last week.
Just to clarify, what is the latest version of Ansi Sql that is currently supported by PB?
When Appeon took over PB from SAP in 2016 it was PB version 12.6. That version's SQL features were still based on the SQL-92 specification.
Appeon PB (AFAIK) still uses that default in the way it "thinks" and "Handles" DML and result sets.
HTH
Regards ... Chris