I wouldn't use a trigger for something that a ON UPDATE CURRENT_TIMESTAMP field could do.
You can also use the trigger for AFTER UPDATE instead of an insert trigger. (its cleaner)
I also have no idea why you're inner joining these tables togeather... Is your problem not as easy as this:
P.S. You can keep the whitespace if you put the code between [C O D E] [/ C O D E] tags (no spaces).Code:CREATE PROCEDURE `GetPersonData`(IN timeStamp DATETIME, person_ID INT) BEGIN SELECT * FROM tPerson UNION ALL SELECT * FROM tPersonAudit WHERE IdPerson = person_ID AND etime <= timeStamp ORDER BY etime ASC END




Reply With Quote
