Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE OR REPLACE TRIGGER users_city_change
- AFTER UPDATE ON users_city
- FOR EACH ROW
- DECLARE
- old_id NUMBER;
- new_id NUMBER;
- BEGIN
- old_id := :old.users_id;
- new_id := :NEW.users_id;
- IF (old_id = new_id) THEN
- INSERT INTO users_city_change_log(
- users_id,
- old_city_id,
- new_city_id
- ) VALUES (
- old_id,
- :old.city_id,
- :NEW.city_id
- );
- END IF;
- END users_city_change;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement