3

从我的 Worklight SQLAdapter 调用用 IBM DB2 编写的存储过程时出现以下错误

过程的调用结果:来自 Worklight 服务器的“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 是我的模式名称,trouble_ticket 是我的表名

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 

我的 SQLadapter 调用函数

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

1 回答 1

2

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

而不是*procedure : "track_ReqByMob_No" *

我会写 * 程序:“TRAVEL.track_ReqByMob_No”*

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

function  track_ReqByMob_No(Mob_No){
    return WL.Server.invokeSQLStoredProcedure({
        procedure : "TRAVEL.track_ReqByMob_No",
        parameters : [Mob_No]
    });
}
于 2014-07-09T14:10:03.957 回答