• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting empty resultset for stored procedure having two returns

 
Sampada Pattalwar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic