MySQL Forums
Forum List  »  Triggers

trigger accessing data in another table before firing in home table
Posted by: Steven DeMonnin
Date: September 12, 2011 08:08AM

I am just studying the docs and learning by working the docs and out of books so forgive if the question is silly.

I have a customer table for a media loan app.
in this table I have things like name, address, etc and a column for amounts owed and a column that is set when the amount owed is greater than zero. but my checkout procedure does not access those columns so the item just is allowed.

I have another column for particular media item which includes a column for which customer has that item.

(Item id, title id, who has the item's customer id)

I have a small procedure that just inserts the customer id into the particular media item table.

Can I have a trigger on the table for the particular media item that checks the customer id table to make sure they don't owe money first before it allows the update to media item table?

Options: ReplyQuote


Subject
Views
Written By
Posted
trigger accessing data in another table before firing in home table
2740
September 12, 2011 08:08AM


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.