IBM Worklight - 如何使用“OUT”参数调用存储过程?

时间:2013-12-27 10:15:14

标签: ibm-mobilefirst worklight-adapters

我们使用SQL适配器,并在调用存储过程时收到以下错误。我们的数据库是Oracle 11g。以下是我们的适配器和程序。

function deals(param) {
    return WL.Server.invokeSQLStoredProcedure({
        procedure : "deals_proc",
        parameters : []
    });
}

,程序是

create or replace procedure deals_proc(c1 out sys_refcursor ) AS 
begin 
open c1 for 
select CATEGORYNAME from DEALS;
end deals_proc;

错误'得到的是

{
   "errors": [
      "Runtime: Failed to retrieve data with procedure : deals_proc"
   ],
   "info": [
   ],
   "isSuccessful": false,
   "warnings": [
   ]
}
控制台错误消息中的

Failed to retrieve data with procedure : deals_proc
FWLSE0101E: Caused by:  [project Test]java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'DEALS_PROC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
java.lang.RuntimeException: Failed to retrieve data with procedure : deals_proc

1 个答案:

答案 0 :(得分:0)

Worklight不支持SQL适配器中的out参数。请参阅此问题:IBM Worklight - How to get OUT parameter when invoking a stored procedure?

我将您链接到的问题还包含一个答案,如果您希望尝试它,则提供详细的解决方法(基本上,覆盖Worklight并在Java代码中实现它)。