Pl sql global 2018 vrai pdf

BASES DE DONNEES RELATIONNELLES PL SQL FOR ORACLE R OULAD HAJ THAMI LES TRIGGERS ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES SOMMAIRE GENERAL MOTIVATIONS STRUCTURE D ? UN BLOC PL SQL LES VARIABLES LES ENREGISTREMENTS ASSIGNATION DES VARIABLES ET AFFECTATION STRUCTURES DE CONTRÔLE LES COLLECTIONS LES TRANSACTIONS INSERT-UPDATE-DELETE DANS UN BLOC PL SQL GESTION DES ERREURS ET DES EXCEPTIONS LES CURSEURS LES PROCEDURES ET LES FOCNTIONS STOCKEES LES PACKAGES LES TRIGGERS ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES LES TRIGGERS DECLENCHEURS ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES Dé ?nition Un déclencheur est un programme qui se déclenche automatiquement suite à un évènement sur une table une base une application ou un évènement système Utilisation des déclencheurs peuvent être utilisés pour la sécurité l'audit l'intégrité des données l'intégrité référentielle la réplication de table le calcul automatique des données dérivées la consignation des événements ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES LES TRIGGERS LMD DECLENCHEURS ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES INSEARpTplIicNaTtiOonE EMPLOYEES EVENEMENT Déclencheur CHECK SAL E EMPLOYEES QUESTIONS EVENEMENT DECLENCHEUR TEMPS DE L ? EXECUTION APRES L ? EVENEMENT DECLENCHEUR AVANT SUR TOUTE LA TABLE SUR CHAQUE LIGNE ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES Syntaxe TRIGGER SUR TABLE CREATE OR REPLACE TRIGGER nomtrigger timing event OR event OR event ON nomtable Corpsdetrigger timing Event BEFORE AFTER INSERT DELETE UPDATE INSERT IF INSERTING THEN ? DELETE IF DELETING THEN ? UPDATE IF UPDATING ? ATTRIBUT ? THEN ? modi ?cation de l ? attribut IF UPDATING THEN ? n ? importe quelle modi ?cation sur la table LE TRIGGER SUR LA TABLE EST DECLENCHE UNE SEULE FOIS SUITE A UN EVENEMENT SUR LA TABLE ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES TRIGGER SUR TABLE Exemple SQL CREATE OR REPLACE TRIGGER ACCES EMP BEFORE INSERT ON E EMPLOYE BEGIN IF TO CHAR sysdate 'DY' IN ? SAT' ? SUN' OR TO CHAR sysdate 'HH ' NOT BETWEEN ' ' AND ' ' THEN RAISEAPPLICATIONERROR - 'Vous ne pouvez pas utiliser la table E EMPLOYE que pendant les heures normales ' END IF END ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES TRIGGER SUR TABLE Exemple CREATE OR REPLACE TRIGGER ACCES EMP BEFORE INSERT OR UPDATE OR DELETE ON E EMPLOYES BEGIN IF TO CHAR SYSDATE 'DY' IN 'SAT' 'SUN' OR TO CHAR SYSDATE 'HH ' NOT BETWEEN ' ' AND ' ' THEN IF DELETING THEN RAISEAPPLICATIONERROR - ? Vous ne pouvez pas supprimer dans la table E EMPLOYE que pendant les heures normales ' ELSIF INSERTING THEN RAISEAPPLICATIONERROR - 'Vous ne pouvez pas ajouter dans la table E EMPLOYE que pendant les heures normales ' ELSIF UPDATING 'SALAIRE' THEN RAISEAPPLICATIONERROR - 'Vous ne pouvez pas modi ?er le SALAIRE dans la table E EMPLOYE que pendant les heures normales ' ELSE RAISEAPPLICATIONERROR - ? Vous ne pouvez pas modi ?er la table E EMPLOYE que pendant les heures normales ' END IF END IF END ORACLE PL SQL CBASES DE DONNEES RELATIONNELLES Syntaxe TRIGGER SUR LIGNE CREATE OR REPLACE

  • 39
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise
Partager
  • Détails
  • Publié le Jul 27, 2022
  • Catégorie Management
  • Langue French
  • Taille du fichier 69.4kB