Skip to Content
0
Former Member
Aug 26, 2015 at 01:16 PM

Getting error while using arrays in sap hana stored procedurecou

65 Views

Hi Experts,

When I am executing the below code, I am getting a compiler error .

Can you please help me resolving the issue.

Error Message :

SAP DBTech JDBC: [2048]: column store error: [34011] failed to save calculation scenario : The following errors occured: Inconsistent calculation model (34011)

Details (Errors):

- CalculationNode ($$DUMMY$$): Internal compiler error at "SREELATR"."ARRAY_AGG_TEST": line 23 col 2 (at pos 761).

Stored Procedure :

CREATE PROCEDURE SREELATR.ARRAY_AGG_TEST()

LANGUAGE SQLSCRIPT

SQL SECURITY INVOKER AS

BEGIN

DECLARE ZDOC_AMNT DECIMAL(34,10) ARRAY;

DECLARE ZlOC_AMNT DECIMAL(34,10) ARRAY;

DECLARE Zfunct_AMNT DECIMAL(34,10) ARRAY;

DECLARE Zgrp_AMNT DECIMAL(34,10) ARRAY;

DECLARE DYNAMICSQL NVARCHAR(1000);

DECLARE VALUE1 DECIMAL(34,10);

TAB = select DOCUMENT_AMNT,LOCAL_AMNT,FUNCT_AMNT,TARGET_AMNT

FROM SREELATR.FACT_TABLE

where DATA_ELMN = 'C6000108';

ZDOC_AMNT := ARRAY_AGG(:tab.DOCUMENT_AMNT);

ZlOC_AMNT := ARRAY_AGG(:tab.lOCAL_AMNT);

Zfunct_AMNT := ARRAY_AGG(:tab.FUNCTI_AMNT);

Zgrp_AMNT := ARRAY_AGG(:tab.TARGET_AMNT);

rst = UNNEST(:ZDOC_AMNT,:ZlOC_AMNT,:Zfunct_AMNT,:Zgrp_AMNT);

value1 := :ZLOC_AMNT[1];

SELECT * FROM :rst;

UPDATE "_SYS_BIC"."OUTPUTTABLE"

SET INFERENCES = 'VALUE IS '||:value1;

END;