Managing Database Triggers for Error Handling and Examples

LES TRIGGERS
 
Les triggers - FG
1
Les triggers - FG
2
Les triggers - FG
3
Les triggers - FG
4
Les triggers - FG
5
Les triggers - FG
6
Les triggers - FG
7
Les triggers - FG
8
Les triggers - FG
9
Les triggers - FG
10
Les triggers - FG
11
Les triggers - FG
12
GESTION DES ERREURS
Les triggers - FG
13
EXEMPLE –
GESTION
ERREUR
Les triggers - FG
14
undefined
Exemples trigger INSERT, DELETE
TAB 2016
CREATE TRIGGER TriDelQualif
AFTER DELETE ON Qualifications
FOR EACH ROW
BEGIN
 
UPDATE Pilote SET nbQualif = nbQualif-1
 
WHERE brevet = OLD.brevet
END;
DELETE FROM Qualifications WHERE typa = ‘A320’;
CREATE TRIGGER TriInsQualif
AFTER INSERT ON Qualifications
FOR EACH ROW
BEGIN
 
UPDATE Pilote SET nbQualif = nbQualif+1
 
WHERE brevet = NEW.brevet
END;
INSERT INTO Qualifications
 
VALUES (‘PL-2’, ‘A380’, SYSDATE());
SLAM3 - BDD
15
undefined
Exemples trigger UPDATE
TAB 2016
CREATE TRIGGER TriUpQualif
AFTER UPDATE ON Qualifications
FOR EACH ROW
BEGIN
 
UPDATE Pilote SET nbQualif = nbQualif-1
 
WHERE brevet = OLD.brevet
 
UPDATE Pilote SET nbQualif = nbQualif+1
 
WHERE brevet = NEW.brevet
END;
UPDATE Qualifications
 
SET brevet = ‘PL-2’
 
WHERE brevet = ‘PL-3’
 
AND typa = ‘A330’ ;
SLAM3 - BDD
16
undefined
TAB 2016
SLAM3 - BDD
17
Slide Note
Embed
Share

Explore the concept of database triggers, specifically focusing on error management scenarios and practical examples for INSERT, DELETE, and UPDATE operations in relational database systems. Learn how triggers can be utilized to maintain data integrity and handle errors effectively.

  • Database Triggers
  • Error Handling
  • Examples
  • Relational Databases
  • SQL

Uploaded on Oct 08, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. LES TRIGGERS Les triggers - FG 1

  2. Les triggers - FG 2

  3. Les triggers - FG 3

  4. Les triggers - FG 4

  5. Les triggers - FG 5

  6. Les triggers - FG 6

  7. Les triggers - FG 7

  8. Les triggers - FG 8

  9. Les triggers - FG 9

  10. Les triggers - FG 10

  11. Les triggers - FG 11

  12. Les triggers - FG 12

  13. GESTION DES ERREURS Les triggers - FG 13

  14. EXEMPLE GESTION ERREUR Les triggers - FG 14

  15. Exemples trigger INSERT, DELETE CREATE TRIGGER TriDelQualif AFTER DELETE ON Qualifications FOR EACH ROW BEGIN UPDATE Pilote SET nbQualif = nbQualif-1 WHERE brevet = OLD.brevet END; DELETE FROM Qualifications WHERE typa = A320 ; CREATE TRIGGER TriInsQualif AFTER INSERT ON Qualifications FOR EACH ROW BEGIN UPDATE Pilote SET nbQualif = nbQualif+1 WHERE brevet = NEW.brevet END; INSERT INTO Qualifications VALUES ( PL-2 , A380 , SYSDATE()); 15 SLAM3 - BDD TAB 2016

  16. Exemples trigger UPDATE CREATE TRIGGER TriUpQualif AFTER UPDATE ON Qualifications FOR EACH ROW BEGIN UPDATE Pilote SET nbQualif = nbQualif-1 WHERE brevet = OLD.brevet END; UPDATE Pilote SET nbQualif = nbQualif+1 WHERE brevet = NEW.brevet UPDATE Qualifications SET brevet = PL-2 WHERE brevet = PL-3 AND typa = A330 ; 16 SLAM3 - BDD TAB 2016

  17. 17 SLAM3 - BDD TAB 2016

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#