ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikael Andersson" <mail.mi...@gmail.com>
Subject Re: Retrieve stored proc return code
Date Mon, 21 May 2007 14:25:08 GMT
Hi,
I'm running into problems getting the return code from a sybase stored
procedure as well.

I have tried the {? = call someproc(?,?)} construct, but it gives me the
following error message :
Cause: java.sql.SQLException: JZ0SC: Callable Statement: attempt to set the
return status as an input parameter.;

I'm no DB guru, quite the opposite, and I've tried various apporaches
without success.
Tried defining a parameter element in the parameterMap, got an error
message.

I have read through what I think are the relevant bits in "iBatis in
Action", but haven't found a solution yet.

Does the stored procedure have to be created in a certain way to allow me to
grab a hold of the status code?

Help greatly appreciated,
Mike




On 19/05/07, Jeff Butler <jeffgbutler@gmail.com> wrote:
>
> By return code, do you mean something that can be obtained like this:
>
> {? = call someproc(?,?)}
>
> If so, then you can use the above syntax and register an output parameter.
>
> Jeff Butler
>
>
> On 5/18/07, BenBaril <benjamin.baril@fbn.ca> wrote:
> >
> >
> > Hi All,
> >
> > I know this issue has come up before, but I'm curious if there is a
> > solution. I am in the process of evaluating iBatis (and we have pretty
> > much
> > decided on it) as the sql mapper for our IT-Revitalization project. We
> > have
> > over 1000 Stored Procedures in a Sybase database. So far we have gotten
> > around issues such as not having a handle on the connection to retrieve
> > RAISERROR messages from a stored procedure as well as limiting the
> > number of
> > results.
> >
> > Our problem right now is that we cannot retrieve the return code from an
> > SP.
> > We rely heavily on return codes to determine why a stored procedure may
> > have
> > failed, and we need these codes to propagate back up the Java stack so
> > we
> > can have a handle on them.
> >
> > Is there a way to do this using iBatis right now?
> >
> > Thank you,
> > Benjamin Baril
> > --
> > View this message in context:
> > http://www.nabble.com/Retrieve-stored-proc-return-code-tf3780537.html#a10691634
> > Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >
> >
>

Mime
View raw message