Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NamedPLSQLStoredProcedureQuery with multiple out parameters(how to get multiple out parameters, using annotation NamedPLSQLStoredProcedureQuery and Query.)
icon5.gif  NamedPLSQLStoredProcedureQuery with multiple out parameters [message #1187464] Fri, 15 November 2013 05:51
Mindaugas Urbontaitis is currently offline Mindaugas Urbontaitis
Messages: 1
Registered: November 2013
Junior Member
EclipseLink version: 2.5.1.
I followed PLSQLStoredFunction example, where is one OUT parameter. I created in database record types and theirs object mirrors, like in example. Created in java class with named plsql stored procedure query with one IN and OUT parameter, which worked:
@NamedPLSQLStoredProcedureQuery(
        name = "getNamedProcedureTmp",
        procedureName = "PS_PACKAGE$.SEL_TMP",  
        parameters = {
            @PLSQLParameter(name = "P_VAL", queryParameter = "P_VAL", databaseType = "PS_PACKAGE$.PS_P_VAL", direction = Direction.IN),                         
            @PLSQLParameter(name = "P_RESULT", queryParameter = "P_RESULT", databaseType = "SYS_REFCURSOR", direction = Direction.OUT_CURSOR)
})

Query query = entityManager.createNamedQuery("getNamedProcedureTmp");
query.setParameter("P_VAL", valueType);
query.setParameter("P_OPTIONS", optionType);
query.getResultList();


And my question is, how i can get working with multiple OUT parameters, like this named query?
@NamedPLSQLStoredProcedureQuery(
        name = "getNamedProcedureTmp",
        procedureName = "PS_PACKAGE$.SEL_TMP",  
        parameters = {
            @PLSQLParameter(name = "P_VAL", queryParameter = "P_VAL", databaseType = "PS_PACKAGE$.PS_P_VAL", direction = Direction.IN),   
            @PLSQLParameter(name = "P_OPTIONS", queryParameter = "P_OPTIONS", databaseType = "API_PACKAGE$.API_P_OPTIONS", direction = Direction.IN_OUT),   
            @PLSQLParameter(name = "P_ERRORS", queryParameter = "P_ERRORS", databaseType = "API_PACKAGE$.API_ERRORS", direction = Direction.OUT),                    
            @PLSQLParameter(name = "P_RESULT", queryParameter = "P_RESULT", databaseType = "SYS_REFCURSOR", direction = Direction.OUT_CURSOR)
})

I tried using, but this not find named plsql parameters:
StoredProcedureQuery query = entityManager.createNamedStoredProcedureQuery("getNamedProcedureTmp");
         query.setParameter("P_VAL", valueType);
         query.setParameter("P_OPTIONS", optionType);
         query.execute();
         query.getOutputParameterValue("P_RESULT");
         query.getOutputParameterValue("P_ERRORS");

java.lang.IllegalArgumentException: You have attempted to set a parameter value using a name of P_VAL that does not exist in the query string PS_PACKAGE$.SEL_TMP.


Founded one example, there using multiple out parameters, but there don't used named query and record types. URL: yenlo.nl/en/calling-oracle-stored-procedures-from-eclipselink-with-multiple-out-parameters/

Is it possible using the named PLSQ stored procedure (or function) query to get multiple OUT parameters? And how?
Previous Topic:EclipseLink & Websphere cluster & Oracle 11g2 DCN
Next Topic:TableGenerator - Sequence/ID Generation
Goto Forum:
  


Current Time: Fri Oct 31 23:56:25 GMT 2014

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

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