Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need to copy a trigger from one schema to another

Uday_NJun 24 2024

Hi All,

I need to copy a trigger from one schema say schema 1 to another schema say schema 2 . Please advise

CREATE OR REPLACE TRIGGER display_salary_changes

BEFORE DELETE OR INSERT OR UPDATE ON customers

FOR EACH ROW WHEN (NEW.ID > 0)

DECLARE sal_diff number;

BEGIN

sal_diff := :NEW.salary - :OLD.salary;

dbms_output.put_line('Old salary: ' || :OLD.salary);

dbms_output.put_line('New salary: ' || :NEW.salary);

dbms_output.put_line('Salary difference: ' || sal_diff);

END;

/

I need to copy this to schema2 from schema 1

Regards,

Uday

Comments
Post Details
Added on Jun 24 2024
3 comments
360 views