MySQL Forums
Forum List  »  Italian

Trigger Complesso
Posted by: Marco Forte
Date: January 17, 2014 08:53AM

Salve a tutti sono uno studente di informatica e sono alle rese con il mio primo DB, ho girato molto su internet ma non riesco a trovare una soluzione.
In poche parole il mio problema è il seguente:
ho bisogno di controllare ad ogni inserimento di una tupla in una determinata tabella se un campo di quella tupla è presente in un altra tabella... se c'è ok posso inserire altrimenti il trigger dovrebbe bloccare l'operazione...
Es

create trigger .... BEFORE INSERT ecc...
BEGIN

IF(NEW.CF notexist(select ....
from...
where...) ) THEN ????
END IF;
END;

1 la struttura puo andare???
2 come fare a specificare di bloccare l'operazione dopo il then???

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger Complesso
1587
January 17, 2014 08:53AM


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.