how to trigger and apply user defined function in mysql

131 Views Asked by At

I have downloaded ta_lib from this site: https://github.com/mysqludf/lib_mysqludf_ta#readme Running mariadb 10.0.20 in centos 7

I am going to make a table for stock A with OHLCV(say table name= stocka) and a list of indicator in another table (say table name= indicatora)

So, I am going to trigger the user defined function (RSI) after inserting the values in "stocka"

I have tried this:
Trigger name: RSI
Table: stocka
Time: AFTER
Event: INSERT

BEGIN
UPDATE indicatora (Date, RSI) VALUES (New.Date, New.ta_rsi(Close, 14);
End

I have tried many time but failed. Could anyone help to solve this problem. Thanks.

0

There are 0 best solutions below