Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Retrieve storedprocedure messages using JPA
Retrieve storedprocedure messages using JPA [message #782393] Mon, 23 January 2012 11:35 Go to next message
Eclipse UserFriend
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 10:48 Go to previous message
Eclipse UserFriend
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.
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: Wed Jul 16 08:13:42 EDT 2025

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

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

Back to the top