我无法使用 JPA @StoredProcedureQuery 或 @StoredNamedProcedureQuery 从 oracle 中的过程中检索数据
PL/SQL
create or replace procedure p_get_plazas_activas(
p_c_resultado out pkg_zas_response.t_response
)
IS
BEGIN
IF p_c_resultado%ISOPEN THEN
CLOSE p_c_resultado;
END IF;
OPEN p_c_resultado FOR
select distinct pl.PLZ_S_ID_PLAZA, pl.PLZ_S_PLAZA
from escaneo.pre_plazas pl, escaneo.pre_cos c
where pl.PLZ_S_ID_PLAZA = c.COS_S_ID_PLAZA
and pl.PLZ_S_PROVEEDOR is null
and pl.PLZ_N_STATUS = 1
and c.COS_N_ACTIVO = 1;
end p_get_plazas_activas;
然后在java中
StoredProcedureQuery spq = em.createStoredProcedureQuery("p_get_plazas_activas");
List results = spq.getResultList();
我得到下一个错误
Internal Exception: java.sql.SQLException: ORA-06550: linea 1, columna 7:
PLS-00306: wrong number or types of arguments in call to 'P_GET_PLAZAS_ACTIVAS'
ORA-06550: linea 1, columna 7:
PL/SQL: Statement ignored
Error Code: 6550
Call: BEGIN escaneo.p_get_plazas_activas(?); END;
bind => [1 parameter bound]
Query: ResultSetMappingQuery()
我也试过
spq.registeterStoredProcedureparameter(1, void.class, ParameterMode.INOUT)
一些忠告??