I have a table called tbl_products, and 3 sub-type of products identified by "V", "L", "C" in the product_type field in tbl_products. I would like to have a trigger identify which product_type it has, and put the data into the appropriate sub-type table. For example:
CREATE TRIGGER insert_vod_product
INSERT ON tbl_products
REFERENCING NEW AS new
FOR EACH ROW WHEN(new.product_type = "V")
(
INSERT INTO tbl_vods(product_id)
VALUES (new.product_id)
);
it will insert a record in tbl_vods if product_type is "V"
is there a way i can identify different product types within one trigger?