2016-02-20 17:32题主

存储过程返回记录集

webbuilder 6.8 ,针对文档中的示例测试储存过程返回值,存储过程在pl/sql中测试运行没问题,在实际应用中,最后结果显示:
oracle 存储过程:
--------------------------------
CREATE OR REPLACE PROCEDURE TEST_USER_PROC
(
P_USER OUT  TYPES.WOER_CURSOR,
P_NAME IN VARCHAR
)
AS
BEGIN
OPEN P_USER FOR SELECT * FROM WB_USER WHERE USER_NAME = P_NAME;
END TEST_USER_PROC;
------------------------------------------------------------
请高手看下,问题出在哪里?在实际应用中,需要返回多条记录

java.sql.SQLRecoverableException: 关闭的语句: getMetaData
    at oracle.jdbc.driver.OracleResultSetImpl.getMetaData(OracleResultSetImpl.java:156)
    at com.webbuilder.controls.DataProvider.outputJsonArray(DataProvider.java:128)
    at com.webbuilder.controls.DataProvider.create(DataProvider.java:91)
    at com.webbuilder.common.Parser.createChildren(Parser.java:182)
    at com.webbuilder.common.Parser.parse(Parser.java:91)
    at com.webbuilder.common.Main.service(Main.java:36)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)


2016-02-21 11:14#1
错误提示信息为结果集关闭了
游标创建了吗?看文档中的说明:
Create Cursor Type
CREATE OR REPLACE PACKAGE TYPES AS
TYPE X_CURSOR IS REF CURSOR;
END;
Create Procedure
CREATE OR REPLACE PROCEDURE USER_PROC
(
P_USER OUT TYPES.X_CURSOR,
P_NAME IN VARCHAR
)
AS
BEGIN
OPEN P_USER FOR SELECT * FROM WB_USER WHERE USER_NAME = P_NAME;
END USER_PROC;
Access Procedure
{call USER_PROC({?@-10.param1?},'admin')}
The SQL syntax "{call proc}" means call a store procedure, "-10" means parameter type oracle.jdbc.OracleTypes.CURSOR, finally the ResultSet will be stored in HttpServletRequest(request.setAttribute("param1",resultSet)).
2016-02-23 16:58#2
游标都定义了,在pl/sql中测试都没有问题,按照上传图片中的步骤,总是出现:"关闭的语句: getMetaData "的错误提示。还需要在哪里设置吗?
2016-02-24 17:00#3
经过多次测试,按文档中的说明来做,可以正常输出结果
你可以根据异常stack调试一下,应该是其他原因导致
2016-06-02 10:46#4
7.0框架中没有resultSet属性可以设置怎么办
2016-06-03 14:00#5
Wb7中dataprovider默认使用过程或函数的返回值或参数名称为result的输出参数

返回开发者社区