Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipse Link StoredProcedure/Function problems

The issue seems to be you are using a StoredFunctionCall but it is a stored
procedure.

You need to use a StoredProcedureCall.

Also you used 3 different procedure names in your example, I assume you have
the correct name and was a typo.



tbianchi wrote:
> 
> I have a complicated stored procedure that I cannot include in this post.
> The header is shown below. The database is Oracle 10g, using EclipseLink
> 1.2 and JDK 5.
> 
> (The stored proc works and is used elsewhere with a JDBC stored proc call
> so broken SQL is not the issue here. )
> 
> procedure call Spec:
> PROCEDURE get_overdue_recs
>     (p_overdue_records OUT csv_pa_types.ref_cursor
>     ,p_report_type IN VARCHAR2)
> 
> I am trying to call the above proc and get a cursor or resultSet back
> using the following code in some method call:
> 
> StoredFunctionCall overdueFunctionCall = new StoredFunctionCall();
> overdueFunctionCall.setProcedureName("CSV_PA.CALL_OVERDUE_CAL");
> overdueFunctionCall.addNamedArgument("p_report_type");
> overdueFunctionCall.returnCursor();
> overdueFunctionCall.useNamedCursorOutputAsResultSet("csv_pa_types.ref_cursor");       
> overdueFunctionCall.setResultSetType(OracleTypes.CURSOR);
>    
> ValueReadQuery overdueQuery = new ValueReadQuery();     
> overdueQuery.addArgument("p_report_type");
> overdueQuery.setCall(overdueFunctionCall);
> 
> List paramList = new ArrayList();
> paramList.add("OVERDUE_1ST_AND_11TH");
> 
> Object obj = session.executeQuery(overdueQuery, paramList);    //procedure
> call
> 
> 
> 
> The above looks pretty simple and looks like it should work but... I get
> the following error. I've included the relevant portion of the stack trace
> below (EL logging level set to "FINEST"): 
> 
> 
> Internal Exception: java.sql.SQLException: ORA-06550: line 1, column 81:
> PLS-00707: unsupported construct or internal error [2603]
> ORA-06550: line 1, column 7:
> PL/SQL: Statement ignored
> 
> Error Code: 6550
> Call: BEGIN ? := CSV_PA_IPAC.GET_OVERDUE_CAL_RECORDS(p_report_type=>?,
> csv_pa_types.ref_cursor=>?); END;
> 	bind => [=> , OVERDUE_1ST_AND_11TH, => ref_cursor]
> Query: ValueReadQuery()
> 
> 
> Can anyone offer some suggestion. I've been wrestling with this for a
> couple days now. Thanks in advance for your help. I don't understand the
> error I am getting or what to try next.
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Eclipse-Link-StoredProcedure-Function-problems-tp28697938p28743500.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top