我在Oracle DB中有一个过程。它的设计如下。
CREATE OR REPLACE PROCEDURE SUMMARY_PAGE(P_NEWID IN number, SHORT_NAME OUT VARCHAR2)
IS
CURSOR C1 IS
SELECT d.short_name "Program Name",
d.number "PD# - P/S:",
FROM des_styles d,ent_workflowstates e1,
WHERE style_id=P_NEWID;
BEGIN
FOR I IN C1
LOOP
EXIT WHEN C1%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(I."Program Name"|| ' '||I."PD# - P/S:");
END LOOP;
end;
/
我有JDBC CODE,如下所示
Connection dbConnection = ConnectionManager.getDBConnection();
String sql="{ call SUMMARY_PAGE(?,?) }";
CallableStatement callStatement = dbConnection.prepareCall(sql);
callStatement.setInt(1, 31146);
callStatement.registerOutParameter(2, Types.VARCHAR);
boolean g = callStatement.execute();
事实是,执行函数返回false。请告诉我如何从上面的代码中获取“Short_Desc”结果。
提前致谢。