Command hangs and doesn't end.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zensunni
    New Member
    • May 2007
    • 101

    Command hangs and doesn't end.

    I'm using this statement to create a trigger that auto-increments a table's primary key:


    [CODE="SQL"]CREATE OR REPLACE TRIGGER trigger
    BEFORE INSERT
    ON test
    REFERENCING NEW AS NEW
    FOR EACH ROW
    BEGIN
    SELECT event_plan_sequ ence.nextval INTO :NEW.id FROM dual;
    END;[/CODE]

    But when I type it into SQL*Plus, it just hangs, as if waiting for a semicolon.

    BTW, I'm using SQL*Plus v9.2 and oracle 10g v 10.2
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    TRIGGER is a keyword.

    use a different name for the trigger.

    Comment

    • zensunni
      New Member
      • May 2007
      • 101

      #3
      Actually, I used trigger as a generic name, just for purposes of listing it here. The real name was something else.

      But, I've solved the problem. Apparently, this command needed a slash ("/") at the end.

      Thanks anyways for the post.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        That means your code was never compiled and you were thinking the system is hanging.

        Comment

        Working...