cancel
Showing results for 
Search instead for 
Did you mean: 

Insert & update SQL statements- help!

Former Member
0 Kudos

Hi all,

i am starting to working on a project with HANA and i came on the point where i need your help.

My program will have one table which will hold measurements (1 min interval - insert) with timestamp. Every minute, when I receive this value i have to add new row (some calculations) into 2 different tables. Which method would best suit this process with best HANA performance.

Thanks for your help.

Bye

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Andraz,

You can create a trigger on insert on your primary table, such that every time an insert happens on your primary table, then you can use the trigger to update/insert into the other two tables. You can also code calculations and transfer values from primary to secondary tables using triggers.

*Note - There is a limitation with this approach however, trigger cannot be used to update/insert/delete from a table that has another trigger. So if you plan to have triggers on the two underlying tables this approach will not work. Another limitation is you can not call procedures from a trigger.

Since you primarily want to update 2 other tables with calculations based on an insert on a primary, triggers would be your best option assuming the above limitations are not factors for your application

Thanks,

Sharan

Former Member
0 Kudos

Hi Andraz,

HANA already provides such a table which holds measurements for time.

Under the _SYS_BI Schema, you will find the table M_TIME_DIMENSION.

The catch would be that this table could be empty, which you will have to fill with the Generate Time Data option in Quick Launch from modeler perspective.

The other table where you would be having some value has to be a separate table.

Now coming to the scenario, I would like to know how are you planning to get the data, real-time or will the values be generated by the program itself while its running?

--Shreepad