Skip to Content

Deleting data from an implicit temporary table inside AMDP in HANA

Hello, My code has implicitly created a 'temp_table' inside an AMDP. I want to partially delete some data from this table but DELETE statement is giving syntax error. What is the solution please? Here below is the code:

CLASS-METHODS: amdp_calc
IMPORTING

value(I_DATA) TYPE Y_T_data_

EXPORTING
value(e_period) type ty_t_period.

METHOD amdp_calc BY DATABASE procedure
for hdb language SQLSCRIPT using /B28/XPFD8HJI.

.…..

.…….

temp_table = SELECT ACCOUNT, CATEGORY FROM :th_table;

delete from :temp_table;

.……

.……..

ENDMETHOD.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 5 days ago

    Using the delete statement for a table variable (not tempoary table as you said) is not supported until know. You can either use the .DELETE operation as described here or "overwrite" the content with some dummy select like e.g.

    :temp_table = select * from :temp_table where 1 = 2;
    Add comment
    10|10000 characters needed characters exceeded