在db2 V9.5中的匿名SQL块中打开游标

时间:2014-07-31 11:54:56

标签: sql db2

我试图编写一个语句来删除所有带有名称的重载过程。但是不能声明游标:

--<ScriptOptions statementTerminator="^"/>
BEGIN ATOMIC
DECLARE cursor_procs CURSOR FOR select SPECIFICNAME from syscat.procedures where PROCSCHEMA = 'DB2INST1' AND PROCNAME = 'CREATE_OR_UPDATE_ARCH' ;
END
^
--<ScriptOptions statementTerminator=";"/>

错误是:

An unexpected token "FOR" was found following "cursor_procs CURSOR".  Expected tokens may include:  "<SQL_variable_declarations>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.16.53

0 个答案:

没有答案