cancel
Showing results for 
Search instead for 
Did you mean: 

Build generic DELETE statements with INNER JOIN @ HDB

Former Member
0 Kudos

Hi all,

we've migrated our crm system on a hdb. Within a small project I would like to benefit from the hdb performance for the following situation:

- Reorganization/deletion of old table entries which are related to records in other tables.

Old fashioned: I would save the the records to be deleted in an itab and delete dbtab from itab.

Question 1: Is there any smarter way to delete related records over several tables (maybe with something like an inner joins?)

Question 2: Better sounds a generic way. I think about customizing table with the relevant information on how to join the tables where deletion should be performed. Within the customizing tables there are rules how to join. A method then will read the customizing and will construct the 'deletion join'.

Do anyone have any idea how to realize that? Maybe with code examples or hints like 'use sql script' or something else?

Thanks in advance

Daniel

Accepted Solutions (0)

Answers (1)

Answers (1)

marcel_scherbinek
Participant
0 Kudos

Hi Daniel,

maybe your question would be better in the SAP HANA Developer space instead of the SAP HANA One space. As you have a general question about processing data in SAP HANA you might get more and a higher quality of answers in the SAP HANA Developer space

You describe a main functionality of a Data Warehouse which isn't available as ready-to-use procedure in SAP HANA, as far as I know. A simple solution as a DELETE statement wouldn't meet your requirements as well (see the SAP HANA SQL reference at DELETE - SAP HANA SQL and System Views Reference - SAP Library). So you have to create one or more SQL procedures to manage the deletion of all referenced data ('use sql script' ).

Maybe some hint how I get started. I often search for standard DWH concepts as for Oracel or MSSQL. Obviously you can't use their SQL but you often see some best practices which might help when you create your own procedure on SAP HANA.

Regards,

Marcel