So I have this University assignment in which I have to create a trigger called bill_overdue. When a row that has status = overdue is inserted into table invoice, a row is inserted into another table called message.
CREATE SEQUENCE AUTOINCREMENTMESSAGE
MINVALUE 100
START WITH 101
INCREMENT BY 1
CACHE 10
;
CREATE OR REPLACE TRIGGER BILL_OVERDUE
BEFORE INSERT ON INVOICE
FOR EACH ROW
WHEN (NEW.STATUS = 'Overdue')
BEGIN
INSERT INTO MESSAGE (MESSAGENO,MESSAGEDATE,ORIGIN,MESSAGE)
VALUES (AUTOINCREMENTMESSAGE.nextval,SYSDATE,USER,:NEW.DATEISSUED,:NEW.INVOICENO,:NEW.CAMPAIGNTITLE);
END;
/
Now as you can see I want to add :new.dateissued, :new.invoiceno and :new.campaigntitle into a single field(message).Now I know that what I have done is wrong but I’ve tried adding parentheses around it etc and nothing seems to do what I want. How do I get this to work? Is it possible to do what I want or have I got it completely wrong?
You could use concatenation