Skip to Content
avatar image
Former Member

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

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
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    May 05, 2017 at 06:42 AM

    Problem solved. Need to put double quote on the temp table

    Add comment
    10|10000 characters needed characters exceeded