帆软JS调用Oracle数据库存储过程返回状态值
参考别人调用没有参数的存储过程
存储过程逻辑
create or replace procedure P_INOUT_DEMO(value2 out SYS_REFCURSOR) is
begin
insert into A
select '999','1','1' from dual
commit;
OPEN value2 FOR
SELECT 'T'
FROM dual;
end P_INOUT_DEMO;
帆软JS调用代码
var sql = 'SQL("定义数据连接","{call P_INOUT_DEMO (?)}",1,1)';
var res = FR.remoteEvaluate(sql);
alert(res);
if ("T" == res) {
alert("发布版本成功!");
} else {
alert("发布版本失败!请联系系统负责人!");
}
调用带参数的存储过程
CREATE OR REPLACE PROCEDURE HF_TEST(A IN NUMBER,B IN NUMBER,value2 out SYS_REFCURSOR) AS
C NUMBER;
BEGIN
C := B+A;
dbms_output.put_line(C);
OPEN value2 FOR
SELECT '成功' FROM DUAL;
end;
帆软JS调用带参数的存储过程
var b = this.options.form.getWidgetByName("A1").getValue();
var e = this.options.form.getWidgetByName("B1").getValue();
var exe ="{call HF_TEST ("+b+","+e+",?)}";
alert(exe);
var sql = 'SQL("定义数据连接","'+exe+'",1,1)';
var zhi= FR.remoteEvaluate(sql);
alert(zhi);
效果图: