MySQL Forums
Forum List  »  Oracle

mutant tables
Posted by: pak attack
Date: March 25, 2006 06:59AM

Hi!

In Oracle the solution for mutant tables is made two triggers,one for each row and other for each table.In version 5.0 triggers are only made for each row.How I solve this problem?Here there is an example of my problem:

CREATE TABLE DATE_TABLE1(
FIRST_DATE DATE,
LAST_DATE DATE
);

DELIMITTER |

CREATE TRIGGER AGE_OK AFTER INSERT ON DATE_TABLE1 FOR EACH ROW
BEGIN
IF NEW.FIRST_DATE > NEW.LAST_DATE THEN
DELETE FROM DATE_TABLE1 WHERE FIRST_DATE = NEW.FIRST_DATE AND
LAST_DATE=NEW.LAST_DATE;
END IF;
END
|


INSERT INTO DATE_TABLE1 VALUES (STR_TO_DATE('12/02/2004','%d/%m/%Y'),STR_TO_DATE('1/01/2000','%d/%m%Y'));

ERROR SAYS:

"CAN'T UPDATE TABLE 'DATE_TABLE1' IN STORED FUNCTION/TRIGGER BECAUSE IT IS ALREADY USED BY STATEMENT WHICH INVOKED THIS STORED FUNCTION/TRIGGER".

THANKS.

Options: ReplyQuote


Subject
Views
Written By
Posted
mutant tables
5804
March 25, 2006 06:59AM
2659
March 26, 2006 03:32PM
2149
March 27, 2006 03:26AM


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.