MySQL Forums
Forum List  »  Triggers

Trigger
Posted by: John Smith
Date: November 20, 2013 07:26PM

We created a Modified Order table, and did not insert any data into it. We then created a trigger that stated that if you update a row in the Order table it triggers an entry into the Order Modified table. It works properly, the only problem is I do not know how to get the Order ID that was updated to be entered into the Order modified table.

Order Modified Table Code:

Create Table Modified_Order (
Modified_Order_Number Int Identity (1,1),
Modified_Order_Date Date,
Order_ID Int,

Foreign Key (Order_ID) references Orders (Order_ID)
);

Trigger Code:

Create Trigger Modified_Order_Trigger

On Orders After Update

AS

Insert Into Modified_Order Values (getdate(), )

;

The issue we are having is getting the Order ID for the order that was updated to show up in the Order Modified table. I know it comes in the spot that is left blank after getdate(), I just am not sure what to put there.

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger
1839
November 20, 2013 07:26PM
1058
November 20, 2013 09:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.