ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bing Qiao <qiaob...@gmail.com>
Subject Re: Get return value of stored procedure
Date Thu, 23 Jun 2005 16:43:48 GMT
I can only get the error message/code from exception raised by
raiserror statement in a stored procedure.

I can't find return code from exception.

Can you suggest me how to do it?

Thanks

On 6/23/05, Larry Meadors <larry.meadors@gmail.com> wrote:
> Sounds like you are using M$ SQL Server - one piece of advice either
> way you go:
> 
> DO NOT use the M$ SQL Server driver. The OSS drivers are still faster
> and less flaky.
> 
> On 6/23/05, Bing Qiao <qiaobing@gmail.com> wrote:
> > Thanks for your reply.
> >
> > First, I was referring to sqlmap, not ibatis dao. Are these two
> > exlusive, jdbc and sqlmap?
> 
> Absolutely not. I have many classes that use both sqlmap and jdbc with
> no issues.
> 
> >
> > Second, I happen to have known that sqlmap supports OUT parameters.
> >
> > As a java developer I have no problem in using OUT parameters.
> >
> > What I was asking is: (1) does sqlmap directly support retrieving
> > RETURN code that is defined as follows in SQL online book.
> >
> > "RETURN
> > Exits unconditionally from a query or procedure. RETURN is immediate
> > and complete and can be used at any point to exit from a procedure,
> > batch, or statement block. Statements following RETURN are not
> > executed."
> 
> I suspect that is going to depend upon the driver, but if it is doable
> with JDBC, it is doable with iBATIS.
> 
> > Obviously, we can catch raiserror (defined as follows from SQL online
> > book) exceptions, but what about the severity level and state? My
> > second question: (2)can we retrieve them as well?
> >
> > "RAISERROR
> > Returns a user-defined error message and sets a system flag to record
> > that an error has occurred. Using RAISERROR, the client can either
> > retrieve an entry from the sysmessages table or build a message
> > dynamically with user-specified severity and state information. After
> > the message is defined it is sent back to the client as a server error
> > message."
> 
> If i am reading this correctly, you want to catch the return value
> from an exception. That should work fine, in spite of it being sort of
> a messy design.
> 
> > I undertand they might be vendor specific, so if no support for them
> > can someone please clarify that? really appreciate your help, thanks a
> > lot!
> 
> No problem.
>

Mime
View raw message