我有一个简单的存储过程:
SELECT NVL(pnum,0)
INTO emp_pnum
FROM employee_pnum
WHERE person_id = i_person_id
AND pn_status_id = (SELECT pn_status_id FROM ems.pn_status WHERE pn_status_desc = 'Active');
SELECT NVL(pnum,0)
INTO old_pnum
FROM employee_pnum_history
WHERE person_id = i_person_id
AND created_date = (SELECT MAX(created_date) FROM ems.employee_pnum_history WHERE person_id = i_person_id);
OPEN x_pnum_history
FOR SELECT emp_pnum,old_pnum
FROM dual;
所以光标x_pnum_history
被返回。我想要的只是将结果集读入一个类,如下所示
EmployeePNum empPnum = new EmployeePNum();
empPnum.setCurrent_pnum(rs.getString("emp_pnum"));
empPnum.setOld_pnum(rs.getString("old_pnum"));
它说
CallableStatementCallback; bad SQL grammar [{call EMS.EMS_PKG.GET_EMP_PNUM(?, ?, ?, ?)}];
nested exception is java.sql.SQLException: Invalid column name
我不确定这里到底出了什么问题......我们非常感谢任何帮助。