aspose file tools*
The moose likes JDBC and the fly likes Getting empty resultset for stored procedure having two returns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Getting empty resultset for stored procedure having two returns " Watch "Getting empty resultset for stored procedure having two returns " New topic
Author

Getting empty resultset for stored procedure having two returns

Sampada Pattalwar
Greenhorn

Joined: Mar 02, 2004
Posts: 1
In my servlet I am using stored procedure which searches in one table on given field. If data is not found in first table searches in other table.
This stored proc is working fine if run from sql prompt( i.e. searches properly in second table if not found in first). It also works fine if data is present in first table but returns empty resultset if the data is in second table. Here I am putting stored procedure structure

if (searchField!=NULL)
begin
searching in first table
if( @@rowcount = 0)
begin
searching in other table
end
end

Pls help me out in solving problem
satish pune
Ranch Hand

Joined: Sep 04, 2003
Posts: 44
Hello ,
Could you please be a little more elaborate
Could you specify the entire code for the sp

Thanks
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30973
    
159

Sampada,
It sounds like you are saying that the stored proc functions differently if run from the command prompt vs JDBC. Can you post the JDBC snipet of your servlet? It could be an interfacing issue.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting empty resultset for stored procedure having two returns