Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Run script to create procedure in DB2
Run script to create procedure in DB2 [message #53805] Fri, 13 March 2009 15:27
Jon Kosmoski is currently offline Jon Kosmoski
Messages: 5
Registered: July 2009
Junior Member
Hi, I am unable to run a script containing the following against a DB2 9.5
using DTP 1.6.2 on Eclipse 3.4.2.
I get errors such as: An unexpected token "END-OF-STATEMENT" was found
following "ARE SQLSTATE CHAR(5)". Expected tokens may include:
"<psm_semicolon>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.50.152

It is as if the --#set terminator @ is being ignored. Does the DTP (as does
SQLExplorer) fail to send the comment to the DB engine?
--#set terminator @
CREATE PROCEDURE my_quiet_drop( IN statement VARCHAR(1000) )
LANGUAGE SQL
BEGIN
DECLARE SQLSTATE CHAR(5);
DECLARE NotThere CONDITION FOR SQLSTATE '42704';
DECLARE NotThereSig CONDITION FOR SQLSTATE '42883';
DECLARE EXIT HANDLER FOR NotThere, NotThereSig
SET SQLSTATE = ' ';
SET statement = 'DROP ' || statement;
EXECUTE IMMEDIATE statement;
END
@

Thanks in advance for any help with this.
Previous Topic:How do I create a Connection Profile
Next Topic:Run script to create procedure in DB2
Goto Forum:
  


Current Time: Sat Aug 30 16:29:32 EDT 2014

Powered by FUDForum. Page generated in 0.01960 seconds