Hy, I have problem calling a procedure in Oracle. My procedure is like the next:
PROCEDURE CloseEpisode(P_CURSOR out sys_refcursor,P_EPIS_ID IN INTEGER) AS BEGIN DELETE FROM sene1_visitas WHERE sene1_visitas.VISI_EPIS_ID = P_EPIS_ID; OPEN P_CURSOR FOR SELECT EPIS_ID, EPIS_EPISODIO FROM sene1_episodios where sene3_episodios_ant.EPIS_ID= P_EPIS_ID; END;
I have the next doubts:
1. I am using the cursor because I am calling this procedure from Hibernate and the documentation says that you have to return a resulset. I cant return anything because its a procedure, right? So the cursor I am using is ok, right? 2. So the format call for the prodecure I am using {?=call closeEpisodio(?,?)}, is it right? 3. In my java code I have done the next things: - if I setInt(2, Integer of EpisId) I get : IllegalArgumentException Positional parameter does not exist: 2 in query: {?=call cerrarEpisodio(?,?)}. . -if I setInt(1, Integer of EpisId) I get the error java.lang.ArrayStoreException. 4. Do I have to set other parameters?
What is wrong?
Thanks
|