on ‎2021 Jun 23 4:57 PM
Hi,
We are trying to use generated columns in our CAP project, but we get errors compiling the cds files.
We are trying the sample from here:
Entity Element Modifiers - SAP Help Portal
like this
entity MyEntity1 {
key id : Integer;
a : Integer;
b : Integer;
c : Integer generated always as a+b;
};
But this results in
Mismatched ‹Identifier›, expecting ‘.’, ‘:’, ‘;’, ‘(’, ‘@’, ‘=’, DEFAULT, ENUM, NOT, NULL
Can hope for this to be supported in the near future?
Thanks!
//Carl
Request clarification before answering.
Hi Carl,
let me first clarify a potential source of confusion:
the sample you are referring to is related to "SAP HANA Core Data Services", which is an implementation of CDS directly embedded into the HANA database (note that HANA CDS is in "maintenance mode" since a few years, no active development is taking place there any more). This is different from CAP CDS, which is implemented in nodejs and/or Java, completely independent of HANA (but of course you can use HANA as the database for your CAP apps). These two products/implementations have different feature sets. While HANA CDS had some focus on supporting many database features, in CAP CDS we rather support only the most basic DB features.
So for your specific question: "generated always as" is not supported in CAP CDS, and we have no plans supporting it.
If you want to make use of HANA features that are not supported directly by CAP CDS, the way to go is to create a native HANA object (table, view) without CAP, and then put a "facade entity" on top of it to enable using the object in CAP CDS. This approach is described here: capire - Using Native SAP HANA Artifacts (cloud.sap)
Best regards, Steffen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.