Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » IN_OUT Parameters not working for NamedStoredProcedureQuery
IN_OUT Parameters not working for NamedStoredProcedureQuery [message #541635] Mon, 21 June 2010 17:14 Go to next message
Eclipse UserFriend
I'm trying to use NamedStoredProcedureQuery with IN_OUT parameters.

I have found that if I pass in either null or "" as the value for my IN_OUT then I will get a message returned in the parameter. However if I pass in, say "0", then I will get "0" as a my returned value. Not exactly the results I was hoping for.

Here is the NamedStoredProcedureQuery, am I doing anything wrong?

@NamedStoredProcedureQuery(name = "ADD_ENROLMENT", procedureName = "pkg_enrolment.add_enrolment",
									returnsResultSet = false,
									parameters = {

@StoredProcedureParameter(queryParameter = "p_enrolment_id", name = "p_enrolment_id", direction = Direction.IN, type=String.class),
@StoredProcedureParameter(queryParameter = "p_v3id", name = "p_v3id", direction = Direction.IN, type=String.class),
@StoredProcedureParameter(queryParameter = "p_v3plan", name = "p_v3plan", direction = Direction.IN,  type=String.class),								  @StoredProcedureParameter(queryParameter = "p_v3careercreatedate", name = "p_v3careercreatedate", direction = Direction.IN,  type=Date.class),
@StoredProcedureParameter(queryParameter = "p_spouseid", name = "p_spouseid", direction = Direction.IN_OUT, type=String.class),
@StoredProcedureParameter(queryParameter = "out_errormsg", name = "out_errormsg", direction = Direction.IN_OUT,  type= String.class)}


EDIT - Formatting of code to be more readable

[Updated on: Tue, 22 June 2010 12:09] by Moderator

Re: IN_OUT Parameters not working for NamedStoredProcedureQuery [message #541824 is a reply to message #541635] Tue, 22 June 2010 12:05 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Have you tried defining the paramater using Direction.IN_OUT, or was that just a mistake in posting?

Best Regards,
Chris
Re: IN_OUT Parameters not working for NamedStoredProcedureQuery [message #541825 is a reply to message #541824] Tue, 22 June 2010 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Hi Chris,

The parameters
p_spouseid
and
out_errormsg
are defined as IN_OUT and those are the ones I am trying to use.

So I pass out_errormsg as "" then I will get an error string but if I pass it in as "0" then I will not get an error string.
Re: IN_OUT Parameters not working for NamedStoredProcedureQuery [message #541848 is a reply to message #541635] Tue, 22 June 2010 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Sounds like something is going wrong in your JDBC driver. Try the same through raw JDBC, do you get the same result. Check that your stored procedure is working correctly as well.

What database are you using? Maybe change it to an OUT instead of an IN_OUT.

Re: IN_OUT Parameters not working for NamedStoredProcedureQuery [message #541886 is a reply to message #541848] Tue, 22 June 2010 18:44 Go to previous message
Eclipse UserFriend
Thanks James,

It turns out my problem was procedure wasn't changing my parameters as I had expected.
Previous Topic:Criteria API + countDistinct + composite primary key
Next Topic:Static Weaving through Eclipse Plug-in
Goto Forum:
  


Current Time: Tue Jul 22 19:28:26 EDT 2025

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

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

Back to the top