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 Go to next message
Mindaugas Urbontaitis is currently offline Mindaugas UrbontaitisFriend
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?
Re: NamedPLSQLStoredProcedureQuery with multiple out parameters [message #1513571 is a reply to message #1187464] Tue, 16 December 2014 17:02 Go to previous message
Craig Jones is currently offline Craig JonesFriend
Messages: 2
Registered: December 2014
Junior Member
Hi,

Did you ever manage to solve this? I'm having similar issues :/
Previous Topic:Eclipselink cache sync
Next Topic:Issue getting SYS_REFCURSOR OUT NamedPLSQLStoredProcedureQuery
Goto Forum:
  


Current Time: Thu Dec 18 12:34:45 GMT 2014

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

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