我有两个我希望在我的存储过程中使用的存储过程,但是一旦我这样做,它就无法加载并显示错误:“提供的参数无效,未检索到行集。”如果我删除其中任何一个,它就会重新开始工作。
我的 Crystal 报告设置如下:
Report: Group By Tenant.ReferedBy stored proc here that calculates the tenant's balance
and the second stored proc is in the Select for the report. I only want to select tenant's by a status flag, and I'm getting the status flag from a stored proc.
Neither of the two procedures are linked together in anyway. One returns one value (the one in the select), the other returns multiple (the one in the group by). Neither take any parameters and are both just simple SQL statements stored on the database.
First Proc: GetAllTenantBalances
SELECT (SUM(tblTransaction.AmountPaid) - SUM(tblTransaction.AmountCharged)) AS TenantBalance, tblTransaction.TenantID
FROM tblTransaction
GROUP BY tblTransaction.TenantID
第二个过程:[GetTenantStatusID_Current]
SELECT ID FROM tblTenantStatus WHERE Description = 'Current'
谁能告诉我为什么我不能这样做,以及如何解决它?
最佳答案
您可以将第一个 sp 更改为仅汇总“当前”租户。或者,如果您必须保留两个 sp,您将必须找到数据库专家并通过租户 ID 加入它们。
关于sql - 如何在 Crystal 报表中使用多个存储过程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/883705/