IBM Worklight - How to call a Stored Procedure with the “OUT” parameter?

冷暖自知 提交于 2019-12-11 05:43:14

问题


We using a SQL adapter and I'm getting the below error while invoking the Stored Procedure. we Our database is Oracle 11g. Below is our adapter and procedures.

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

and the procedure is

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

and the error 'm getting is

{
   "errors": [
      "Runtime: Failed to retrieve data with procedure : deals_proc"
   ],
   "info": [
   ],
   "isSuccessful": false,
   "warnings": [
   ]
}

in console error message is

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:


Worklight does not support the out parameter in SQL adapters. See this question: IBM Worklight - How to get OUT parameter when invoking a stored procedure?

The question I linked you to also contains an answer providing an elaborate workaround if you wish the try it (basically, override Worklight and implement it in Java code).



来源:https://stackoverflow.com/questions/20798817/ibm-worklight-how-to-call-a-stored-procedure-with-the-out-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!