存储过程不返回结果集

时间:2014-11-24 14:25:00

标签: java sql-server-2008 stored-procedures

我有以下存储过程 -

DECLARE @TMPFundContextIds TABLE                    
(                   
FundContextId INT                   
)                   

INSERT INTO @TMPFundContextIds                  
        ( FundContextId )                   
SELECT F.ContextId FROM Core.Fund AS F                  
INNER JOIN Core.Engagement AS E ON F.EngagementId = E.EngagementId                  
WHERE E.FiscalYearEnd ='09/30/2014' AND Symbol 
IN ('9p13','9P16','4816','38RU','38MG','IABS','IABM','W4B6','LQ44')

 SELECT                     
 FundSymbol                     
,TestTargetTypeDisplayName          
,COUNT(AssetCode)AS AssetCodeCount      
 FROM TargetTesting.vw_OpenSalesRiskbasedTargetResults  AS VOPRTR                   
 INNER JOIN @TMPFundContextIds TMP ON VOPRTR.FundContextId = TMP.FundContextId  
 GROUP BY FundSymbol,TestTargetTypeDisplayName
 ORDER BY FundSymbol,TestTargetTypeDisplayName  

我从Java代码中调用此SP:

CallableStatement cstmnt=conn.prepareCall("{call [Core].[usp_OSRBTBaseLine]}");

它显示错误消息," 状态表未返回结果集"

任何人都可以帮助我,我将如何得到结果集或我在做错误的地方。谢谢adavacne .. :)
注意:我在帖子中读到,当我们使用临时表时,我们不应该使用prepareCall()。所以我也试过了 ResultSet rs=stmt.executeQuery("{call [Core].[usp_OSRBTBaseLine]}");
在这种情况下,我也收到了相同的错误消息。

0 个答案:

没有答案