问题描述
是否可以在DB2 Command Center中的过程
之外执行过程语言?例如,我需要能够声明
一些变量并做一些类似于下面的
样本的条件处理。我们使用的是DB2 UDB 8.1.6。
BEGIN SAMPLE
DECLARE SYSTEM_NAME CHAR(10);
SET SYSTEM_NAME =' 'IWT''
如果SYSTEM_NAME =''IWP''那么
在STG.TABS上创建独特的索引TEST1(数字);
END IF;
结束样本
当我尝试运行时,我收到以下错误。
DB21034E命令被处理为SQL语句,因为它是
而不是
有效的命令行处理器命令。在SQL处理期间它返回
:
SQL0104N意外的令牌BEGIN SAMPLE发现在
BEGIN-OF-STATEMENT之后。预期的令牌可能包括:< create_proc>。
SQLSTATE = 42601
Spencer
Is it possible to execute procedural language outside of a procedure
in DB2 Command Center? For instance I need the ability to declare
some variables and do some conditional processing similar to the
sample below. We are on DB2 UDB 8.1.6.
BEGIN SAMPLE
DECLARE SYSTEM_NAME CHAR(10);
SET SYSTEM_NAME = ''IWT''
IF SYSTEM_NAME = ''IWP'' THEN
CREATE UNIQUE INDEX TEST1 ON STG.TABS(NUMBER);
END IF;
END SAMPLE
When I try to run I get the following error returned.
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0104N An unexpected token "BEGIN SAMPLE" was found following
"BEGIN-OF-STATEMENT". Expected tokens may include: "<create_proc>".
SQLSTATE=42601
Spencer
sp*****@tabbert.net
推荐答案
这篇关于DB2 SQL过程语言外部过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!