Stored Procedure Call [message #634296] |
Thu, 21 October 2010 07:47 |
Manuel Messages: 5 Registered: October 2010 |
Junior Member |
|
|
Hi,
i'm trying to execute a simple stored procedure call with EclipseLink on an Oracle 10g database. The procedure is defined like this:
PROCEDURE test_procedure (input_vch IN VARCHAR2, output_vch OUT VARCHAR2)
IS
BEGIN
output_vch := 'Glückwunsch - Aufruf Erfolgreich! Eingabe war: ' || input_vch;
END test_procedure;
And my EclipseLink code looks like this (just copied and adapted from the user guide example):
StoredFunctionCall functionCall = new StoredFunctionCall();
functionCall.setProcedureName("BVX_RAT_PROTOTYP.TEST_PROCEDURE");
functionCall.addNamedArgument("INPUT_VCH");functionCall.setResult("OUTPUT_VCH", String.class);
ValueReadQuery query = new ValueReadQuery();
query.setCall(functionCall);
query.addArgument("INPUT_VCH");
List args = new ArrayList();
args.add("Eingabe");
String valid = (String) session.executeQuery(query, args);
but this results in the following error:
[EL Warning]: 2010-10-21 09:42:14.395--DatabaseSessionImpl(27021384)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.1.v20100817-r8050): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-06550: Row 1, Column 14:
PLS-00306: Wrong number or type of arguments in call of 'TEST_PROCEDURE'
ORA-06550: Row 1, Column 7:
PL/SQL: Statement ignored
Error Code: 6550
Call: BEGIN ? := BVX_RAT_PROTOTYP.TEST_PROCEDURE(INPUT_VCH=>?); END;
bind => [=> OUTPUT_VCH, Eingabe]
Query: ValueReadQuery()
Any idea how to correct this?
I'm not that familiar with stored procedures, but on first sight my code seems valid, because it defines 1 input parameter.
Regards,
MS
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04116 seconds