Showing results for 
Search instead for 
Did you mean: 

Delete in HANA Stored procedure temporary table

0 Kudos

Hi All,

I have a stored procedure with logic like as follows. I am getting an error like "

sql syntax error: incorrect syntax near ":lt_mara": line 201 col 2"

lt_mara = select * from MARA where matnr like 'PART%' ;

delete from :lt_mara where matnr = 'PART-AB';

I am trying to delete a particular set of records from temporary table based on condition.

Is this possible in SAP HANA ? will it work only for query on DATABASE TABLE rather than temporary table ?

I agree there is an alternate way to select from LT_MARA where MATNR <> PART-AB .

I want to know why the delete does not work ? Is it because the lt_mara was created at runtime, the compiler giving error for delete statements ?



Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

Hello Gokul,

SQLScript does not support a DELETE for "internal" tables. It is just supported for catalog/repository tables.

A way you can simulate the delete in your situation is to do an additional select on the "internal" table, like e.g.:

lt_mara = select * from :lt_mara where martnr <> 'PART-AB';



Answers (0)