0

I'm using a trigger that triggers AFTER INSERT, when the user inserts data into the the table i want to be able to use the information that was just inserted into the table in my trigger.

Is there any way to do this?

0

1 Answer 1

1

Use the special variable new to get the data for the new added row(s), as described in the manual at 13.1.22 CREATE TRIGGER Statement

Within the trigger body, you can refer to columns in the subject table (the table associated with the trigger) by using the aliases OLD and NEW. OLD.col_name refers to a column of an existing row before it is updated or deleted. NEW.col_name refers to the column of a new row to be inserted or an existing row after it is updated.

Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, i totally glossed over that, this is my bad and i should not have missed this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.