November 2019

S M T W T F S
      12
34 5 678 9
10111213141516
17181920212223
24252627282930

Style Credit

Expand Cut Tags

No cut tags
Wednesday, October 5th, 2005 06:01 pm (UTC)


CREATE OR REPLACE TRIGGER orders_before_update
BEFORE UPDATE
ON orders
FOR EACH ROW

DECLARE
v_username varchar2(10);

BEGIN

-- Find username of person performing UPDATE on the table
SELECT user INTO v_username
FROM dual;

-- Update updated_date field to current system date
:new.updated_date := sysdate;

-- Update updated_by field to the username of the person performing the UPDATE
:new.updated_by := v_username;

END;

Reply

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting