|Run script to create procedure in DB2 [message #53805]
||Fri, 13 March 2009 15:27
| Jon Kosmoski
Registered: July 2009
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) )
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;
Thanks in advance for any help with this.
Powered by FUDForum
. Page generated in 0.01620 seconds