cancel
Showing results for 
Search instead for 
Did you mean: 

SELECT on views with join and/or union is not supported

gregorw
Active Contributor

Hello CAP Community,

I'm in the upgrade process from CDS 5.4 (Release August 2021) to CDS 5.6 (Release November 2021). That worked fine until I've made a request to an action that does a SELECT on a View that contains a JOIN. In 5.4 that worked just fine. Now with 5.6.4 it fails. This is the error log:

Error: SELECT on views with join and/or union is not supported
    at module.exports (/node_modules/@sap/cds/libx/_runtime/common/error/index.js:6:24)
    at _checkForForbiddenViews (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:486:13)
    at _getTransitionData (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:502:32)
    at getTransition (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:545:50)
    at /node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:567:16
    at Array.map (<anonymous>)
    at _entityTransitionsForTarget (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:560:19)
    at _newQuery (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:598:23)
    at resolveView (/node_modules/@sap/cds/libx/_runtime/common/utils/resolveView.js:616:20)
    at ApplicationService.handle (/node_modules/@sap/cds/libx/_runtime/cds-services/services/Service.js:131:17) {

The function that is called there is called _checkForForbiddenView.

Looking forward for your input how we can resolve this issue. I've checked the changelogs but I haven't found any indication in this direction.

CU
Gregor

gregorw
Active Contributor
0 Kudos

I've filed also the Incident 845393 / 2021

Accepted Solutions (1)

Accepted Solutions (1)

vansyckel
Advisor
Advisor

Hi gregorw

SELECTs on views that contain joins can only be executed by a DatabaseService, as we cannot join two entities served by, for example, a remote service (e.g., S/4).

Best,
Sebastian

Answers (0)