原因:com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error



当从我的Worklight SQLAdapter调用在IBM DB2中编写的存储过程时,我得到以下错误

从Worklight Server调用过程:'track_ReqByMob_No'的结果:

{
   "errors": [
      "Runtime: Failed to retrieve data with procedure : track_ReqByMob_No"
   ],
   "info": [
   ],
   "isSuccessful": false,
   "warnings": [
   ]
}
控制台输出

[ERROR   ] FWLSE0099E: An error occurred while invoking procedure  [project Raoming_Advisor]SQLAdapter/StoredProcedureFWLSE0100E:  parameters: [project Raoming_Advisor]

Failed to retrieve data with procedure : track_ReqByMob_No
FWLSE0101E: Caused by:  [project Raoming_Advisor]com.ibm.db2.jcc.am.SqlSyntaxErrorException:
DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884, SQLERRMC=TRACK_REQBYMOB_NO;PROCEDURE,
DRIVER=3.66.46java.lang.RuntimeException: Failed to retrieve data with procedure : track_ReqByMob_No

我在DB2中的存储过程(TRAVEL是我的模式名,麻烦票是我的表名)

CREATE PROCEDURE track_ReqByMob_No (IN MOB_NO BIGINT )
DYNAMIC RESULT SETS 1
P1: BEGIN
DECLARE cursor2 CURSOR WITH RETURN for
SELECT TRAVEL ."trouble_ticket"."id", TRAVEL."trouble_ticket"."query_trouble_ticket",TRAVEL."trouble_ticket"."status_trouble_ticket"    FROM TRAVEL."trouble_ticket" WHERE TRAVEL."trouble_ticket"."Mob_No"=MOB_NO;
        OPEN cursor2;
END P1 

My SQLadapter calling function

function  track_ReqByMob_No(Mob_No){
    return WL.Server.invokeSQLStoredProcedure({
        procedure : "track_ReqByMob_No",
        parameters : [Mob_No]
    });
}

在调用函数中使用的模式名,例如我的模式名是TRAVEL,所以在我的SQLadapter调用函数

代替*procedure: "track_ReqByMob_No" *

我将写* procedure: "TRAVEL.track_ReqByMob_No"*

---------- 我UPADTED SQLadapter调用函数 ----------

function  track_ReqByMob_No(Mob_No){
    return WL.Server.invokeSQLStoredProcedure({
        procedure : "TRAVEL.track_ReqByMob_No",
        parameters : [Mob_No]
    });
}

相关内容

  • 没有找到相关文章

最新更新