Skip to Content
0
May 11, 2016 at 11:25 AM

Error in Executing String Query in SAP B1 Version for HANA

485 Views

Dear All,

I'm facing some error while executing a procedure in HANA System. My requirement is to calculate output based on Formula defined at UDT.

Formula will be change dynamically, but the Input Parameters are same for all the Formula.

The Logic is perfectly working in SQL Server System. But when i developed query for HANA, its throwing an error.

Request All of them to Help me on this.

Please find the below Procedure for Formula Calculation :-

CREATE PROCEDURE TEST_V1

(IN SalesType1 decimal(19, 2), IN Additional1 decimal(19, 2))

LANGUAGE SQLSCRIPT SQL SECURITY INVOKER AS

Begin

Declare Formula nvarchar(5000)='';

Select "U_Formula" Into Formula From "SBODEMOIN"."@IK_FORMULA";

/*

-- (:NetSalesType + (:NetSalesType * :Addtn)/100) -- This is the Formula from Table

*/

Exec('

Declare NetSalesType Decimal(19,2) = 0.0;

Declare Addtn Decimal(19,2) = 0.0;

NetSalesType := ' || :SalesType1 || ';

Addtn := ' || :Additional1 || ';

Select ' || :Formula || ' From Dummy

');

End;

--Drop Procedure SBODEMOIN."TEST_V1"

--Call SBODEMOIN."TEST_V1" (1000,10)