vendredi 28 novembre 2014

How to convert PostgreSQL trigger procedure to H2 (in-memory db) trigger procedure?


Vote count:

0




I have PostrgreSQL database and trigger function



CREATE OR REPLACE FUNCTION save_order_in_history()
RETURNS TRIGGER
AS $$
BEGIN
INSERT INTO order_table_history (order_id, total_price, user_id, product_amount)
VALUES (NEW.id, NEW.total_price, NEW.user_id, NEW.product_amount);
RETURN NULL;
END $$ LANGUAGE plpgsql;

CREATE TRIGGER order_trigger AFTER INSERT OR UPDATE
ON "order_table" FOR EACH ROW EXECUTE PROCEDURE save_order_in_history();


How can I convert it to H2 database (I use in-mem variant) trigger? If it is possible of cause.



asked 22 secs ago







How to convert PostgreSQL trigger procedure to H2 (in-memory db) trigger procedure?

Aucun commentaire:

Enregistrer un commentaire