Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Retrieve storedprocedure messages using JPA
Retrieve storedprocedure messages using JPA [message #782393] Mon, 23 January 2012 16:35 Go to next message
Sridhar Baratam is currently offline Sridhar BaratamFriend
Messages: 22
Registered: September 2011
Junior Member
Hello All:

I have a stored procedure which prints messages. I am using JPA named query to execute the same. However, I could not find a construct within JPA that will allow me to capture the messages from the stored procedure.

Here is my sample procedure:
********************************
create proc test
@text varchar(255)
AS
declare
@col int
SELECT @col=col
FROM table
WHERE text=@text

IF @@error != 0 BEGIN
print 'Invalid text'
return -100
END
return 1
go
********************************

How do I get the message 'Invalid text' using JPA?

I appreciate all your help.

Thanks
Sridhar
Re: Retrieve storedprocedure messages using JPA [message #783859 is a reply to message #782393] Thu, 26 January 2012 15:48 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What database are you using? I don't thin print is in any way returned, it just prints something on the server. You need to either throw an error, or return an error message using an output parameter.


James : Wiki : Book : Blog : Twitter
Previous Topic:update in new transaction hangs program
Next Topic:Embedded object with null values in db cause instances not to be updated
Goto Forum:
  


Current Time: Sun Nov 23 03:45:24 GMT 2014

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

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