on 2020 Oct 22 4:30 PM
Hi Hana Experts,
We are using HANA 2.0 SPS02 On-Prem edition.
Our developers are having trouble propagating Hana Table Column Comments to View Column Comments.
This is the create view documentation: https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.05/en-US/20d5fa9b75191014a33eee9269...
Here is the COMMENT ON documentation: https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.05/en-US/20d3817075191014ba7bcfdbab...
So our objective is to write views and consume the views in Calculation views and use the Comment on the column for the Calculation View's Column Label.
For Table Columns consumed in a CV, extract semantics is available to populate the labels. But for Views which have no Comments, the underlying Table Columns can not be used to extract semantics.
It's very tedious to write a view of a table with all the comments when there are multiple tables involved, which is why we want to only write the comment for the base tables and have the views auto-generate the View Column Comment.
For single table views, we can extract the comments from the underlying table with the following:
SELECT 'COMMENT ON COLUMN ' || SCHEMA_NAME || '.' || '<table_name>.' || COLUMN_NAME || ' IS ''' || COMMENTS || ''';'FROM TABLE_COLUMNS WHERE SCHEMA_NAME = '<schema_name>' AND TABLE_NAME = '<table_name>';
and re-run the COMMENT ON SQL on individual Views.
Any suggestions?
Request clarification before answering.
I'm looking to do this for views too.
Creating tables and views through the Catalogue/Repositories.
For a table we can do this:
{name = "COL_NAME"; sqlType = NVARCHAR; length = 128; comment="Columns comes from table X";}
Want to do similar for views when creating them like this:
schema="ETL";
public=false;
query="
select COL_NAME // somehow add a comment to this view-column
from xxx
";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
40 | |
15 | |
10 | |
9 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.