SQLTeam.com | Weblogs | Forums

How to make this trigger

mysql

#1

Hello I am new to the forum, I have the following problem, I want after I delete a lease table locations I go in the table films and have the film's status to available, but if I have the movie code in table location in another record, I still let the situation of the film table column as leased, how would I do that?

that's what I've done before I did with the film code, but did not seem right, now I did by the id of the lease:

TRIGGER `tguDelete` AFTER DELETE ON `locacoes` FOR EACH ROW UPDATE filmes SET situacao = 'Disponivel' WHERE codigo_filme= OLD.codigo_filme

Please help me!


#2

Looks like Oracle?

This is a Microsoft SQL Server forum, so you might find that folk here are not very familiar with Oracle.


#3

Looks like perhaps MySQL or DB2 variant to me. Oracle's triggers are much uglier than that :-).


#4

:slight_smile:

I'll go with plain "Not MS SQL" then :toast:


#5

I will be the same thing.