Hi there,
I would like someone to help me in achieving and creating trigger, actually I didn't study PLSQL so just only I know SQL, so that's why I'm seeking someone to support me please. Oracle Database version 19.12.0.0.0
I have a table, and this table as following:
CREATE TABLE PRODUCT(
product_expiry_date DATE,
product_expiry_status VARCHAR2(50),
period NUMBER);
I want to update a column (Product_expiry_status) based on trigger after a record inserted, and it will be either to {Expired or Notexpired} based on a condition that when column (Period) equal to 40.
The SQL update will be as following:
UPDATE product
SET product_expiry_status = 'Expired'
WHERE period >= 40;
And I want either the same trigger to do another task as well but this trigger will schedule a run daily and check a target due date, and based on due date condition it will update the value of one column which is (Product_expiry_status) to either {Expired or NotExpired}.
The SQL update will be as following:
UPDATE product
SET product_expiry_status = 'Expired'
WHERE product_expiry_date >= '10-JAN-2022';