Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Stanimir Stamenkov" Subject: Re: JPA Calling an Oracle Message-ID: X-Comment-To: comp.lang.java.databases Newsgroups: comp.lang.java.databases Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 40 Date: Wed, 27 Apr 2011 15:22:13 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303917733 96.60.20.240 (Wed, 27 Apr 2011 10:22:13 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:22:13 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.databases:180 To: comp.lang.java.databases 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 --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24