[英]SSRS subscription with cursor
In my (ssrs) data-driven subscription I try to use cursor.在我的(ssrs)数据驱动订阅中,我尝试使用 cursor。 The result that I need: number of letters should be equal to the lines the cursor returns.
我需要的结果:字母数应该等于 cursor 返回的行数。 Example:
例子:
SET ANSI_WARNINGS ON
DECLARE cur CURSOR FOR
SELECT * FROM #ForResult
OPEN cur
WHILE 1 = 1
BEGIN
FETCH NEXT FROM cur INTO @ID, @CommittedBy, @FlightNumber, @Dep, @DateBeg, @Carrier, @Arr
IF @@FETCH_STATUS <> 0 BREAK
SELECT CONVERT(VARCHAR(10), @DateBeg, 104) AS [DateBeg]
, CONVERT(VARCHAR(10), @DateBeg, 104) AS [DateEnd]
, @Dep AS [AP]
, @FlightNumber AS [FlightNumber]
, 'email@y.ru' AS [Recip]
, 'Отчет '
+ @FlightNumber
+ ' от ' + CONVERT(VARCHAR(10), @DateBeg)
+ ' а/к ' + @Carrier
+ ' ' + @Dep + ' - ' + @Arr
+ ' // ' + @CommittedBy AS [Subject]
END
CLOSE cur
DEALLOCATE cur
SET ANSI_WARNINGS OFF
SET ANSI_WARNINGS solved problem Cannot read the next data row for the dataset
SET ANSI_WARNINGS 解决的问题
Cannot read the next data row for the dataset
But subscription return only first cursor-result.但是订阅只返回第一个游标结果。 How can I return all rows in different letters?
如何以不同的字母返回所有行?
Is this the only code you have, because in SSRS, the code works very different than TSQL.这是您拥有的唯一代码吗,因为在 SSRS 中,代码的工作方式与 TSQL 非常不同。 It should be case sensitive, parameters which are string may work differently.
它应该区分大小写,字符串参数的工作方式可能不同。 Make sure you have it in a SP with all ANSI settings properly defined and run them again
确保在 SP 中正确定义了所有 ANSI 设置并再次运行它们
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.