Skip to Content
0
Former Member
May 05, 2017 at 06:19 AM

[SAP HANA] - SUM() function inside temp table error

142 Views Last edit Aug 22, 2017 at 08:46 AM 2 rev

Hi experts, I just want to know if it is possible to used function inside temp table?

CREATE PROCEDURE "SBODEMOAU"."test" AS (in oCardCode varchar(50)) 
BEGIN

l_data = SELECT SUM("DocTotal") "Sum_amount" FROM OINV WHERE "CardCode" = :oCardCode;
CREATE LOCAL TEMPORARY TABLE "#TempVat" AS (SELECT * FROM :l_data);
SELECT * FROM #TempVat;
DROP TABLE "#TempVat";
);


END

I've received this error:

Could not execute 'CREATE PROCEDURE "SBODEMOAU"."test" (in oCardCode varchar(50)) As BEGIN l_data = SELECT ...'
SAP DBTech JDBC: [7]: feature not supported: Cannot use local temporary table inside a procedure/function: #TEMPVAT