Oracle trigger where clause updating

INTO Clause - The INTO clause is used to specify the target table into which you are inserting or updating.

USING Clause - The USING clause specifies the source of the data to be updated or inserted.

CREATE or REPLACE TRIGGER emp_after_insert AFTER INSERT ON emp FOR EACH ROW DECLARE BEGIN insert into emp_backup values (:new.empid, :new.fname, :new.lname); DBMS_OUTPUT.

PUT_LINE('Record successfully inserted into emp_backup table'); END; Second Problem: We want o update a record in the ’emp_backup’ table if a corresponding record is updated in the ’emp’ table.

' On Delete'); END IF; END statement_level; / set serveroutput on INSERT INTO orders (somecolumn) VALUES ('ABC'); UPDATE orders SET somecolumn = 'ZZT'; DELETE FROM orders WHERE rownum CREATE TABLE person ( fname VARCHAR2(15), lname VARCHAR2(15)); CREATE TABLE audit_log ( o_fname VARCHAR2(15), o_lname VARCHAR2(15), n_fname VARCHAR2(15), n_lname VARCHAR2(15), chng_by VARCHAR2(10), chng_when DATE); BEGIN INSERT INTO audit_log (o_fname, o_lname, n_fname, n_lname, chng_by, chng_when) VALUES (: OLD.fname, : OLD.lname, : NEW.fname, : NEW.lname, USER, SYSDATE); END referencing_clause; / INSERT INTO person (fname, lname) VALUES ('Dan', 'Morgan'); SELECT * FROM person; SELECT * FROM audit_log; UPDATE person SET lname = 'Dangerous'; SELECT * FROM person; SELECT * FROM audit_log; UPDATE person SET fname = 'Mark', lname = 'Townsend'; SELECT * FROM person; SELECT * FROM audit_log; COMPOUND TRIGGER BEFORE STATEMENT IS BEGIN ...

Leave a Reply

  1. Chat video online free usa 13-Dec-2017 23:35

    "Nicki is not the type to date around," our insider shared.

  2. limitations carbon 14 dating 24-Oct-2017 04:24

    A fallout with Nano Comm led i CUii to rewrite its app from scratch for PC-only.

  3. Free browsing sex dating 08-Oct-2017 06:35

    Little is known about Siebert, other than the fact that she was a 22-year-old receptionist who Lowe met at a club in 1986.

  4. obama lady gaga intimidating 28-Sep-2017 14:01

    Every chat site featured here comes with an in-depth review, precise facts and updated details so you can find the entertainment you seek within moments. At Top Chats.com, you’ll find the best live sex cam sites online.

  5. bishop noel jones dating paula white 23-Oct-2017 12:27

    By going through each snapshot, you will easily be able to choose a girl for you.