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
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.