Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » java.sql.SQLException: ORA-00900 calling StoredProcedure
java.sql.SQLException: ORA-00900 calling StoredProcedure [message #493858] Wed, 28 October 2009 10:07 Go to next message
George Badu is currently offline George Badu
Messages: 13
Registered: July 2009
Junior Member
Hi all

I was wondering if some one would be kind enough to help me with an error that I keep getting. I have a stored procedure which doesn't take any parameters. when I try and call it, I get the following error. the funny thing is I have other stored procedure which take parameters which I can all successfully with no problems. It only seems to happen with procedures that do not have any parameters. I have tested the procedure in both SQL plus and Sqldeveloper and it works fine. I am using OC4J 10.1.3.4, Oracle DB 10.2.0.4 eclipselink/toplink as the JPA provider and I am also using the oracle thin drivers i.e. ojdbc14.jar.

Can anyone help please?

Internal Exception: java.sql.SQLException: ORA-00900: invalid SQL statement

Error Code: 900
Call: BEGIN testJPAProc(); END;
Query: DataReadQuery()



Here is the procedure
create or replace procedure testJPAProc is 
 
 begin
 dbms_output.put_line('testJPAProc called');
 end;


Heres is java code for calling the procedure

                                StoredProcedureCall call = new StoredProcedureCall();
  
		ValueReadQuery query = new ValueReadQuery();
		
		call.setProcedureName("testJPAProc");
		query.setCall(call);
		
		session.executeQuery(query);




thanks
Re: java.sql.SQLException: ORA-00900 calling StoredProcedure [message #493972 is a reply to message #493858] Wed, 28 October 2009 15:56 Go to previous message
George Badu is currently offline George Badu
Messages: 13
Registered: July 2009
Junior Member
Hi All,

I have found the solution.

It turns out that I was using the wrong query type. I should have been using DataModifyQuery instead of DataReadQuery/ValueReadQuery as the function returns nothing!!. I changed the query type to DataModifyQuery and it works now.
Previous Topic:JPA and JAXB Annotated POJOs
Next Topic:provide mappings that are not on the classpath
Goto Forum:
  


Current Time: Sat Sep 20 22:05:01 GMT 2014

Powered by FUDForum. Page generated in 0.13212 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software