• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting SQL Exception although stored procedure is correct!!!

 
Vinayachandra Acharya
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using SQL Server 2000 database and i have some stored procedures to retrieve the data. I am using JDBC driver for SQL Server 2000. After making some changes to one of the stored procedures i am getting SQLException although the query analyzer shows correct output for that stored procedure:-(

this is the exception i am getting:

INFO [STDOUT] SQLException in STT_Beans.STT_EntityBeans.SearchListEntity.loadTeamMembersRequests(): java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'in'.

ERROR [STDERR] java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'in'.

ERROR [STDERR] at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)

ERROR [STDERR] at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)

ERROR [STDERR] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
ERROR [STDERR] at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
ERROR [STDERR] at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinayachandra,
Query analyzer is often more forgiving than the actual query compiler. Probably because query analyzer doesn't have to execute an actual query.

Please post the snippet of the stored proc that is causing the error.
 
Vinayachandra Acharya
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for the reply...

but the problem was in sending the parameter... a where clause was sent as the i/p parameter to the stored proc.... but it was not handled properly inside the stored proc...

now problem is resolved :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic