on 06-10-2019 8:44 AM
Hi Friends,
According to below link:
Using Dynamic Filters in SAP HANA by Rich Heilman, APPLY_FILTER statement does not use dynamic SQL and no association with EXEC statement, so there should be no related performance issues when using APPLY_FILTER.
I have a procedure which has multiple Dynamic SQL with Exec Statement. So, I need to optimize them. However, my source which happens to be a calculation view vary with different condition, Hence, my source for APPLY_FILTER will also by dynamic. The POC is shown below where P_SOURCE_CV will be an input from other procedure based on some parameters. When I try to activate this procedure, I get an error - SAP DBTech JDBC: [1310]: scalar type is not allowed: P_SOURCE_CV: line 9 col 1 (at pos 183)
PROCEDURE "TEST_APPLYFILTER" (
IN P_SOURCE_CV VARCHAR(400)
)
LANGUAGE SQLSCRIPT
SQL SECURITY DEFINER
AS
BEGIN
DECLARE V_FILTER VARCHAR(1000) DEFAULT 'COMPANY_CD = ''1001''';
ex_products = APPLY_FILTER(:P_SOURCE_CV, :V_FILTER ) ;
SELECT * FROM :ex_products;
END;
Please tell me how to achieve above scenario with APPLY_FILTER.
Thanks,
Gaurav
HANA 2.0 SP3
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.