Skip to content
Advertisement

can I place a sql query in a sql hana place holder

can I place a sql query in a sql hana place holder?

the following query works:

I am trying to pass something like the following:

Currently getting a syntex error

Advertisement

Answer

As error says you, expressions are not supported for column view parameter: Can't use column expression as column view parameter.

However, there are options to calculate it:

  • If your parameter’s value is semantically related to this calculated view (e.g. you need some default value for this view that is calculated based on some logic), then you can create a stored procedure with one output parameter to calculate the value, and use parameter type Derived From Procedure/Scalar Function. To make that value adjustable from frontend you can mark it as Input enabled. Or if calculated value is based on user input, you can map input parameters of procedure to input parameters of calculation view in section Parameters/Variables -> Procedures/Scalar functions for input parameters.

13

  • If your parameter’s value is not related to calculation view and you just use calculation view to get some data for that value, you can use the result set feature of stored procedure/SQLScript block. If your SQL executor does not attempt to parse SQL statement (for example, SAP BO checks for SELECT as the first SQL word after some SP onwards, so this way will not be valid for it) and just gets result set as metadata for column definitions, then you can avoid extra object to wrap calculation logic.

To return a result set, use a SELECT statement because anonymous blocks do not have any parameters defined.

That with calculation view based on the table RSPCLOGCHAIN filtered by output of the procedure declared above gives me

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement