Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @NamedStoredProcedureQuery & Out Parameter:(I am trying to call a procedure with 2 parameters of type IN , and Out. but getting exception.)
icon8.gif  @NamedStoredProcedureQuery & Out Parameter: [message #652409] Thu, 03 February 2011 19:09 Go to next message
Azhar Sikander is currently offline Azhar SikanderFriend
Messages: 4
Registered: February 2011
Junior Member
I am getting following exception:

PLS-00306: wrong number or types of arguments in call to 'SITE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Code:

@NamedStoredProcedureQuery(
name = "loadQuery",
procedureName = "SITE",
returnsResultSet = false,
resultClass = CSite.class,
parameters = {
@StoredProcedureParameter(queryParameter = "Code", direction = Direction.IN),
@StoredProcedureParameter(queryParameter = "Type", direction = Direction.OUT),

@StoredProcedureParameter(queryParameter = "Loc", direction = Direction.OUT)}

and:----

Query q = em.createNamedQuery("loadQuery");
q.setParameter("iCode", "STTLWA06");
CSite xyz = (CSite) q.getSingleResult();

Can somebody Please help??

[Updated on: Thu, 03 February 2011 19:17]

Report message to a moderator

Re: @NamedStoredProcedureQuery & Out Parameter: [message #652551 is a reply to message #652409] Fri, 04 February 2011 14:06 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

We can't help much without more information such as the stored procedure signature in the database, and the SQL that gets generated. Try setting
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.parameters" value="true"/>
to have the SQL used show up in the logs.

Also, you may want to try naming the parameters, and specifying the type to the input parameter. Be aware that you are specifying that the procedure return a CSite entity class, and that this will corrupt the cache with incomplete entities if all CSite fields are not returned by the procedure.

Best Regards,
Chris
Re: @NamedStoredProcedureQuery & Out Parameter: [message #653129 is a reply to message #652409] Tue, 08 February 2011 15:29 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Also you call the parameter "Code" in the annotation, but "iCode" in the query execution.


James : Wiki : Book : Blog : Twitter
Previous Topic:Unwanted aggregated child cascade delete
Next Topic:How to call Oracle function from eclipselink
Goto Forum:
  


Current Time: Thu Mar 28 19:34:37 GMT 2024

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

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

Back to the top