從 SAP HANA 中的臨時表中刪除


臨時表是會話特定的。因此,你需要像下面這樣使用 truncate 代替 delete

truncate table #temptable;

另外,可以檢查一下你的發行版嗎?在最近的版本中,delete 也能很好執行。下面是一個例子

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

更新日期:2019 年 12 月 5 日

751 個瀏覽

開啟你的職業生涯

完成課程後獲得認證

開始吧
廣告
© . All rights reserved.