Hi, in this video at 10:30 mins you have executed build at correct level (DB module) only but still it got failed and at 13:10 min again you did build on same thing (DB module) . Could you please explain why build failed first time and it got successful in second time.
The first time at 10:30 I believe I actually did just hit some kind of bug in the builder process. During my troubleshooting (some of which I cut of the video) I did build at the wrong level at one point. I included that explanation. Ultimately though I was able to just successfully build from the /db level again later and it worked fine the next time. Sorry if that was a little confusing.
Does the db artifacts, synonym and the entity have to have the same name? Suppose my db atrifact in container 1 is abc and the synonym is xyz and the entity in the synonym container is def. will this scenario work where all three are named differently. I feel synonym and the entity ( with @cds.persistence.skip) has to have the same name or the entity name has to be same as the DB artifact for which we are creating synonym.
The CAP CDS entity and the underlying database object (in this case synonym) object must match exactly (including case in the naming). It is only via this assumed exact matching that things work. There is no design time or build checks when you use @cds.persistence.skip. It is only at runtime when CAP goes to run a query using the metadata of the entity alone that you learn if there is a mismatch. However the synonym and the inner DB target object don't have to match. Using a synonym is often how you can overcome a DB object name that isn't compatible with CAP. [Thomas Jung]
@@sapdevs I have created a view by executing a select distinct on the CDS ( same name as the synonym). The view is created but when i am trying to check the content of the view in the DB explorer as an application user, i am getting "insufficient privilege" with the GUID error. Do i need to create default_roles files to override the roles assigned to the application user.
@@rajkrishna184 You should lookup the GUID to see what is exactly missing from your authorization. The hdbgrants should provide the container technical users with the authorization it needs. You don't need to adjust the default_access_role if you setup the hdbgrants properly. [Thomas Jung]
@@sapdevs CALL SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS ('80D2F6307AC02A4FABD6946198160259', ?) is also giving insufficient privilege error. I am able to view the data in the db explorer for synonyms. i have created a CDS entity with same name as the synonym and then i am creating a view on the synonym CDS enitity by doing a select query.I am getting the error for insufficient privilege error When i am trying to view data in the db explorer for this new view which is specific to my container only. Do i need special privilege to do a select query on synonym. If that's the case then i should not be able to see the data in data preview for synonym as well.
@@rajkrishna184 >CALL SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS ('80D2F6307AC02A4FABD6946198160259', ?) is also giving insufficient privilege error. You can't call the GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS with an HDI container technical user. You must use a DB user which some considerable security or overall admin rights. If you are working in HANA Cloud Trial, then please use DBADMIN user to get these details.
How to make column case insensitive. For example I am creating a view using synonym select distinct { xyz }. But while deploying SAP is looking for column XYZ which is not there in the table/view. Column name is xyz not XYZ. How do i make the column insensitive column query? I want to do this in my .cds file.
Those are considered "quoted" names and not supported by CAP CDS. The workaround is to create a HANA native view (HDBVIEW) on the artifact and create alias names that do conform to CAP CDS. cap.cloud.sap/docs/advanced/hana#quoted-names
Hi, in this video at 10:30 mins you have executed build at correct level (DB module) only but still it got failed and at 13:10 min again you did build on same thing (DB module) . Could you please explain why build failed first time and it got successful in second time.
The first time at 10:30 I believe I actually did just hit some kind of bug in the builder process. During my troubleshooting (some of which I cut of the video) I did build at the wrong level at one point. I included that explanation. Ultimately though I was able to just successfully build from the /db level again later and it worked fine the next time. Sorry if that was a little confusing.
Does the db artifacts, synonym and the entity have to have the same name? Suppose my db atrifact in container 1 is abc and the synonym is xyz and the entity in the synonym container is def. will this scenario work where all three are named differently. I feel synonym and the entity ( with @cds.persistence.skip) has to have the same name or the entity name has to be same as the DB artifact for which we are creating synonym.
The CAP CDS entity and the underlying database object (in this case synonym) object must match exactly (including case in the naming). It is only via this assumed exact matching that things work. There is no design time or build checks when you use @cds.persistence.skip. It is only at runtime when CAP goes to run a query using the metadata of the entity alone that you learn if there is a mismatch. However the synonym and the inner DB target object don't have to match. Using a synonym is often how you can overcome a DB object name that isn't compatible with CAP. [Thomas Jung]
@@sapdevs I have created a view by executing a select distinct on the CDS ( same name as the synonym). The view is created but when i am trying to check the content of the view in the DB explorer as an application user, i am getting "insufficient privilege" with the GUID error. Do i need to create default_roles files to override the roles assigned to the application user.
@@rajkrishna184 You should lookup the GUID to see what is exactly missing from your authorization. The hdbgrants should provide the container technical users with the authorization it needs. You don't need to adjust the default_access_role if you setup the hdbgrants properly. [Thomas Jung]
@@sapdevs CALL SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS ('80D2F6307AC02A4FABD6946198160259', ?) is also giving insufficient privilege error. I am able to view the data in the db explorer for synonyms. i have created a CDS entity with same name as the synonym and then i am creating a view on the synonym CDS enitity by doing a select query.I am getting the error for insufficient privilege error When i am trying to view data in the db explorer for this new view which is specific to my container only.
Do i need special privilege to do a select query on synonym. If that's the case then i should not be able to see the data in data preview for synonym as well.
@@rajkrishna184 >CALL SYS.GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS ('80D2F6307AC02A4FABD6946198160259', ?) is also giving insufficient privilege error.
You can't call the GET_INSUFFICIENT_PRIVILEGE_ERROR_DETAILS with an HDI container technical user. You must use a DB user which some considerable security or overall admin rights. If you are working in HANA Cloud Trial, then please use DBADMIN user to get these details.
How to make column case insensitive. For example I am creating a view using synonym select distinct { xyz }. But while deploying SAP is looking for column XYZ which is not there in the table/view. Column name is xyz not XYZ. How do i make the column insensitive column query? I want to do this in my .cds file.
Those are considered "quoted" names and not supported by CAP CDS. The workaround is to create a HANA native view (HDBVIEW) on the artifact and create alias names that do conform to CAP CDS. cap.cloud.sap/docs/advanced/hana#quoted-names