Forum Stats

  • 3,872,065 Users
  • 2,266,376 Discussions
  • 7,911,043 Comments

Discussions

How to Create a Trigger

869358
869358 Member Posts: 1
edited Jun 16, 2011 5:54PM in General Database Discussions
I am using Oracle SQL Developer Data Modeler, and am looking to create insert triggers. How do I fill out the Trigger Properties window? For instance, when a value is entered on table 1, but its not an option on table 2, I want the trigger to insert "NA". How is this done?

Thanks! Any help is appreciated!

Answers

  • riedelme
    riedelme Member Posts: 3,528
    This might be a better question to ask in the SQL*Developer forum. You can find it under

    Development Tools
    + Application Development in PL/SQL

    on the site menu.

    I personally write SQL*PLUS scripts to create triggers so I automatically have an offline copy as a back-up if needed later, something like (untested)
    CREATE OR REPLACE TRIGGER my_trigger
    after INSERT my_table
    FOR EACH ROW
    BEGIN
      insert into my_table2(
        column1
      )
      values(
      'value1'
      );
    END;
This discussion has been closed.