Re: JPA Calling an Oracle function with OUT parameter



Thu, 12 Jun 2008 16:29:39 +0300, /Stanimir Stamenkov/:

Query query = em.createNativeQuery("{ ? = "
+ "call MY_FUNCTION(?,?,?,?,?,?,?) }");

query.setParameter(1, null); // XXX: registerOutParameter ?
query.setParameter(2, ...);
...
query.setParameter(7, ...);

List result = query.getResultList();

I don't know how I can register (and later get) the first parameter as OUT parameter, pretty much like one could do with JDBC (java.sql.CallableStatement), and I'm getting an exception as:

java.sql.SQLException: Missing IN or OUT parameter at index:: 9

The last line actually states:

java.sql.SQLException: Missing IN or OUT parameter at index:: 8

The "index:: 9" comes from an experiment I've made adding one more ",?" to the function parameters, but seems no matter how many question marks I add it always asks for an additional OUT one. If I don't add additional ",?" and try to set:

query.setParameter(8, ...);

I get an "java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!" at that line.

--
Stanimir
.



Relevant Pages

  • Re: Class not registered error
    ... A similar thing happened to me and it ended up being a missing file: ... > ssdggrid so I had a look at some other suspicious looking dll files. ... > I then proceeded to do a Google search on the CLSID, ... > find mfc32.dll so I tried registering that, ...
    (microsoft.public.vb.general.discussion)
  • Re: How do you call ?
    ... >> The Doncaster Register office is located at Elmfield Park, Doncaster, DN1 ... Any adult has the right to go missing! ...
    (uk.local.yorkshire)
  • Re: Compiling 1.9.1p0 on AIX 5.3 using xlc
    ... I've tried to register on redmine to be able to log these things as ... The missing symbols reported when loading encdb.so were rb_encdb_declare ... rtld: 0712-002 fatal error: exiting. ...
    (comp.lang.ruby)
  • Re: Working on all computers but 1
    ... You are missing an activeX control on that machine or it is on the machine ... register it with RegSvr32.exe. ... result in the name of a macro, name of udf, or Event Procedure. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Unable to display the user selection dialog. Class not registered
    ... You might be missing "Security Shell Extension" component from your image. ... Try to add and register rshx32.dll library. ... I though mabe I just have to give the user access to that exe using the ...
    (microsoft.public.windowsxp.embedded)