Skip to Content
0

HANA procedure , syntax to delete table emtries.

Nov 14, 2016 at 07:32 AM

305

avatar image
Former Member

Hi All,

I have created a HANA sql procedure. which is something like :

itab0 = select * from ......;

itab1 = select ....... from itab0;

itab2 = select ........ from itab1;

i want delete all entries from table once it is of no use further. For example after Itab1 fetches data from itab0 including some calculations , then I want to make itab0 empty. to free its memory. but DELETE FROM :ITAB0 is not working.

what is the syntax to do so?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Nov 14, 2016 at 08:12 AM
0

I think with some refactoring of your coding you will not have such situations you are thinking about (from my opinion at the moment the coding looks like ABAP coding several years old).

But just from a technical side. DELETE/TRUNCATE are not supported on SQLScript delcared table variables. One option to "remove" the entries would be to make a dummy select with a where-condition producing no result.

itab0 = select * from :itab0 where 1 = 2;

Regards,
Florian

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Florian,

Could you please suggest me any document or website where i can learn new methods for writing SQL procedures in HANA?

0

I think a good starting point is the SAP HANA SQLScript Reference and the SAP HANA development courses provided at OpenSAP.

Regards,
Florian

0