Newdeptname uppernewdeptname end before row executed

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
:NEW.dept_name := UPPER(:NEW.dept_name); END; Before Row Executed once for each record affected by the triggering SQL statement before the record in question is changed, deleted, or inserted. After Row Executed once for each record affected by the triggering SQL statement after the record in question has been changed, deleted, or inserted. The correlation names : OLD and :NEW deserve some extra explanation. It is common when writing a trigger to need to reference the values in the record being inserted, updated, or deleted. Further, in the case of an update, it is often necessary to access both the before and after values of a given field. The correlation names :OLD and :NEW are provided for this purpose. These function much like a PL/SQL record. :OLD contains the field values before they are updated, and :NEW contains the field values after the update takes place. Use the standard dot notation, in other words :OLD.field_name, to refer to the value of a particular field. You will see examples of this in several of the listings in this chapter.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
On insert CREATE OR REPLACE TRIGGER emp_dept_ins 2: AFTER INSERT ON emp_dept
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern