invalid attribute for SQL procedure及GET DIAGNOSTI

db2inst1@cyper-pc:/home/cyper/swap/procedure$ db2 -td@ -f FMSSPA01
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0628N  Multiple or conflicting keywords involving the "<invalid attribute 
for SQL procedure>" clause are present.  LINE NUMBER=29.  SQLSTATE=42613

解决
CREATE PROCEDURE FMSSPA01(IN IN_FUNDING_GRP_ID DECIMAL(15,0),
                          OUT OUT_SQLCODE INTEGER)
  specific FMSSPA01
  LANGUAGE SQL
  FENCED
  MODIFIES SQL DATA
  PROGRAM TYPE SUB
  DYNAMIC RESULT SETS 0

去掉不识别的attribute即可

db2inst1@cyper-pc:/home/cyper/swap/procedure$ db2 -td@ -f FMSSPFGA
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 "1" was found following "GNOSTICS CONDITION  ".  
Expected tokens may include:  ".".  LINE NUMBER=20.  SQLSTATE=42601

  DECLARE EXIT HANDLER FOR SQLEXCEPTION
    GET DIAGNOSTICS CONDITION
       1 OUT_SQLCODE   = DB2_RETURNED_SQLCODE
       , OUT_SQLERROR  = MESSAGE_TEXT;

改为

  DECLARE EXIT HANDLER FOR SQLEXCEPTION
    GET DIAGNOSTICS OUT_SQLCODE = DB2_RETURN_STATUS;
    GET DIAGNOSTICS EXCEPTION 1 OUT_SQLERROR  = MESSAGE_TEXT;

参考:http://sqlpl-guide.com/GET_DIAGNOSTICS

http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0005647.html?cp=SSEPGG_9.7.0%2F2-10-6-128



转载于:https://my.oschina.net/uniquejava/blog/325325

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值