Hi Will,
Someone posed the same question one week ago. I think this answer from Maury
Hammel should help you out:
"I found that the problem was that the code had ';' characters inside of it.
SQuirreL doesn't know anything about procedures or code blocks, so it scans
the single block of code for the ';' character, and breaks the block into
multiple SQL statements. It then tries to execute each statement
separately, which the database engine chokes on.
Try changing the Session SQL property 'Statement Separator' from ';' to
something else ('/' for example), and then try your procedure again like so:
create procedure test1
language sql
begin
<sql statements>;
end;
/
Of course, you'll have to change the property back to ';', after creating
your procedure if you want the ';' to remain the termination character for
single SQL statements.
Maury"
Regards,
Matt
-----Original Message-----
From: squ...@li...
[mailto:squ...@li...] On Behalf Of Will
Handley
Sent: Wednesday, March 22, 2006 10:59 AM
To: squ...@li...
Subject: [Squirrel-sql-users] Creating Triggers in Oracle 10g
Following ddl:
CREATE OR REPLACE TRIGGER PAPCAT.TR_S_12796_1_PROCUREMENT_PLAN
BEFORE INSERT ON PAPCAT.PROCUREMENT_PLANNING_REPORT
FOR EACH ROW
BEGIN
SELECT PAPCAT.S_12796_1_Procurement_Plan.nextval
INTO :new.ID
FROM dual;
END;
should create the trigger:
BEGIN
SELECT PAPCAT.S_12796_1_Procurement_Plan.nextval
INTO :new.ID
FROM dual;
END;
Instead, it somehow hangs on the first semicolon and the (invalid) trigger
is created as:
BEGIN
SELECT PAPCAT.S_12796_1_Procurement_Plan.nextval
INTO :new.ID
FROM dual
Note that the semi-colon after dual as well as END; is missing.
Any way I can get the entire trigger to be submitted as a unit?
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Squirrel-sql-users mailing list
Squ...@li...
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
|