cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Script to create views

Former Member
0 Likes
544

How to create the views (attribute, analytic, calculation) using scripts rather than following the HANA studio?

This will help in automating this steps involved and increase productivity, especially while migration the application from another database.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Richard,

Thanks for the reply.

Based on our current understanding of HANA's views, to address our requirement for muti-tenancy and highly dynamic nature of the analytical queries we figured the only option would be to dynamically generate the calculation view based on the user selection of the attributes, measures and measure aggregate functions.

Thought this might not be an optimal or recommended usage, we feel it can address our requirement as long as there is a way to automate these steps without depending on HANA studio. So while evaluating this approach we ran into the below questions:

  • The functions CE_CALCULATED_VIEW, CE_JOIN_VIEW can only be called from SQLScript in the Calculation view or they can be executed from JDBC/ regular SQLScript?
  • How to create a "SQLScript based Calculation view" using SQLScript/ JDBC API/ XML file for automation?
  • When we try to add input parameters to the "Calculation View", there are only options to add Date/Currency/ a predefined set of input  values. Is there a way we can allow the user defined string as input parameter?
  • Can Activation of procedures/ calculation views/ attribute views/ join views be done through SQLScript statements in a SQL Editor?

Regards

Rahul

lucdealethea
Participant
0 Likes

Hi Rahul,

go a little deeper and assess the use of CREATE PROCEDURE WITH OVERVIEW.

Then consume the view created by the procedure.

I think that this should resolve your bullets.

Rgds,

Luc.

richard_bremer
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Rahul,

in the SQL Script Guide for HANA (development section on https://help.sap.com/hana_appliance) you find multiple examples of creating SQL Script Procedures or Calculation Views (SQL Script Procedures with result view) programmatically, i.e. via SQL calls and not via the modeler add-on to SAP HANA Studio.

As for Attribute Views and Analytic Views, there is no public API available in order to generate them. In principle, one can generate Analytic Views via SQL and you can find something out by running activation in SAP HANA Studio and carefully analyzing the activation logs - however, I don't want to recommend this, as it will not be supported by SAP. You can also look at the export of data models and easily find out how to generate that XML (again without API support), but also here we may change the layout of these exports and SAP will not support this.

So the answer is: Calculation Views you can easily generate via SQL and thus programmatically. Analytic Views can basically not be generated programmatically.

Best regards,

Richard

--

Dr. Richard Bremer

Customer Solution Adoption (CSA), SAP AG