- This topic has 4 replies, 2 voices, and was last updated 19 years, 3 months ago by CallaWou.
-
AuthorPosts
-
CallaWouMemberHelllo,
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.
support-michaelKeymasterHmmm! 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;
CallaWouMemberHello,
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_07Thank you for the help.
Kind Regards.
Eric.
support-michaelKeymasterJust 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.
CallaWouMemberOK. Thank you for the explanation.
Bye.
Eric.
-
AuthorPosts