cancel
Showing results for 
Search instead for 
Did you mean: 

Decision Table in Web Based Development Workbench + UDF Function in CDS

former_member460045
Participant
0 Kudos

Hi experts,

1. I want to use a decision table, but I'm modelling with the Web Based Development Workbench. I did not find any way to create one. Is there any?

2. Is there a possibility to create UDF table functions in the Web Based Development Workbench. Is it possible by the .hdbtablefunction or even by CDS?

3. I want to pass a two values into a procedure within a graphical calc view and return the output of the procedure as column. Is there any way?

Thanks and best regards

Johannes

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

1. I would not suggest the use of decision tables. They are obsolete and don't cover to HDI/XSA which you eventually must move to.

2. You can create table functions with HDBTABLEFUNCTION in the old Repository.

3. You can use a table function (procedure) as a data source in a Calculation View.

former_member460045
Participant
0 Kudos

Hi Thomas,

thanks for your answers. A few questions arise:

1. How can I avoid it. Yes, I can create a calculated column, if I dont have many criterias, but how to handle it, if I have a lot of rows in my decision table. Is there any to go if I have a large decision datasets?

To be precise I want to decide based on the name, a MaxValue and a minValue and return a specific column of the reference table.

My thought was to do this with the help of a table function in the view. With your tips 2/3 I have created the function and it works properly in Catalog. How can I now pass a specific column of a Projection as input parameter for this function and how can I use the output in the graphical view?

There is no possibility to create a connection from the projection to the table function in graphical view.

Thanks and best regards

Johannes

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

1. I would suggest probably a table function if possible.

2. When you add the table function as a data source in the view, you have the option to map into the parameters of the table function.

>There is no possibility to create a connection from the projection to the table function in graphical view.

What kind of node are you trying to use. Most likely you need a join or union. Also what release of HANA. The ability to use a table function in a Calculation View is relatively recent.

former_member460045
Participant
0 Kudos

Hi,

We are using 1.00.122.16.1520578817.

the problem I have with that is, that there are no parameters shown and also no output columns of the table function.

This is the code of the hdbtablefunction:

FUNCTION "<Schema>"."<Name>" (
    -- parameters input -- 
    IN messagePriority varchar(15), 
    IN age integer
)
RETURNS table("flag" varchar(15), "priority" varchar(15))
   LANGUAGE SQLSCRIPT
   SQL SECURITY INVOKER
   --DEFAULT SCHEMA <default_schema_name>
   READS SQL DATA AS
BEGIN
    
        return (SELECT "flag", "priority" FROM "<Table>"
        WHERE "priority" = messagePriority
            AND age >= "minValue"
            AND age <= "maxValue");
            
END;<br>

When I add it as datasource, there are not output columns and no parameters shown.

Its completly strange, because I created a new calc view, there i had the parameters but no output column. I deleted that one again and now there is neither of both.

Thank you.

Best regards

Johannes

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Have you tried the same from the HANA Studio. I really wouldn't recommend the use of the Web-based Development Workbench in general any longer and certainly not for Calculation View development.

former_member460045
Participant
0 Kudos

Hi,

yes, in HANA Studio is everything working fine. The last thing im struggling is how to pass specific columns of a projection as input parameters for the table function in the graphical calc view?

Best regards

Johannes

Answers (0)