如何将提取行计数写入平面输出文件中的预告片记录
我使用转换对象“行计数”来捕获写入外部平面文件的行数,现在我想向该文件添加预告片记录。
目前,我将 Traielr 记录附加到同一个文件中,方法是重新执行用于提取详细记录的 SQL,然后计算返回的行数,如下所示:
SELECT
'T' AS TLR_REC_TYPE,
TLR_NBR_RECORDS = (
SELECT Count(1) + 2 --Include Header row and this Trailer row in count
FROM
(***=Insert SQL used to query Detail records here***)
)
我第一次尝试使用 RowCount 转换对象。我相信我已经将其设置为详细信息 rowCount 现在位于用户变量中。如何将此用户变量写入预告片记录,以便预告片行的格式为:
T,{RowCount}
I used the Transformation object "Row Count" to capture the number of rows written to an external flat file and now I want to add a Trailer record to that file.
Currently, I append a Traielr record to the same file by essentially reexecuting the SQL that I used to extract the Detail records and then counting the rows returned, something like this:
SELECT
'T' AS TLR_REC_TYPE,
TLR_NBR_RECORDS = (
SELECT Count(1) + 2 --Include Header row and this Trailer row in count
FROM
(***=Insert SQL used to query Detail records here***)
)
I am trying to use teh RowCount transformatiobn obejct for the first time. I believe I have it set up where the Detail rowCount is now in a user Variable. How do I write this user Variable to the trailer record so the Trailer row has the format:
T,{RowCount}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加引用用户变量的派生列。
Add a derived column that references the user variable.