Deleting from temporary table in SAP HANA


The temporary tables are session specific. So you would require to use truncate instead of delete as follows

truncate table #temptable;

Also, could you please check your release? In the recent releases, delete also works fine. Here is an example:

Drop table #temptable;
Create local temporary table #temptable(id integer, str nvarchar(30));
Insert into #temptable values (1,'abc');
Insert into #temptable values (2,'xyz');
Select * from #temptable;  --> returns 3 rows
Delete from #temptable;
Select * from #temptable;--> returns 0 rows

Vikyath Ram
Vikyath Ram

A born rival

Updated on: 05-Dec-2019

553 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements