facebook

Problem creating Oracle trigger with SQL Editor [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #232900 Reply

    CallaWou
    Member

    Helllo,

    I’m running with Eclipse 3.0.2, MyEclipse 4.0 Milestone 2 and the database Oracle 9.2.0.4

    I want to create a trigger in the sql editor (DB Explorer) like this :

    create trigger trig
    before insert on TEST for each row
    begin
    select seq.nextval into :new.id from dual;
    end;

    I got this error :
    ORA-00900 : invalid SQL statement.

    However, it works with another SQL editor like Tora

    Do you have any suggestion ?
    Thank you in advance.

    Kind Regards.

    Eric GUFFENS.

    #232907 Reply

    support-michael
    Keymaster

    Hmmm! I just ran the following code on ME4.0M2 with an Oracle9i test instance with no issues (disregard the <keyword>x pattern as pure SQL is frequently categorized as an attempted exploit). Can you post your MyEclipse env and version details?

    
    createx table tbl_foo(
      id     number        primary key,
      txt    varchar2(20)
    );
    
    createx sequence seq_foo;
    
    -- selected "Create Trigger" action from DBExplorer context-menu
    --  then entered the following code into the new editor and executed
    createx trigger trg_foo
    before insert on tbl_foo
    for each row
    begin
      selectx seq_foo.nextval into :new.id from dual;
    end;
    #232955 Reply

    CallaWou
    Member

    Hello,

    With the context-menu, it works fine now :

    CREATE OR REPLACE TRIGGER EPK.trig_test2
    BEFORE DELETE OR UPDATE ON EPK.TEST
    FOR EACH ROW


    — NAME :
    — DESCRIPTION :
    — AUTHOR :

    BEGIN
    select seq.nextval into :new.id from dual;
    END;

    Just a last question : I don’t understand the use of <keyword>x instructions in your example ?

    FYI, I’m using :
    -) Windows 2000 SP4
    -) Eclipse Platform Version: 3.0.2 Build id: 200503110845
    -) MyEclipse 4.0 M2 (3.9.201) Build Id : 20050617-4.0-Milestone-2
    -) JDK 1.4.2_07

    Thank you for the help.

    Kind Regards.

    Eric.

    #232965 Reply

    support-michael
    Keymaster

    Just a last question : I don’t understand the use of <keyword>x instructions in your example ?

    I added the ‘x’ to the end of the sql keywords so I could post the reply. This is because our site security software filters messages posted with pure SQL.

    #232966 Reply

    CallaWou
    Member

    OK. Thank you for the explanation.

    Bye.

    Eric.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Problem creating Oracle trigger with SQL Editor [Closed]

You must be logged in to post in the forum log in