ASE ISQL 输出到文件,有时为空或空白
给出这个unix脚本,它是计划批处理运行的:
isql -U$USR -S$SRVR -P$PWD -w2000 < $SCRIPTS/sample_report.sql > $TEMP_DIR/sample_report.tmp_1
sed 's/-\{3,\}//g' $TEMP_DIR/sample_report.tmp_1 > $TEMP_DIR/sample_report.htm_1
uuencode $TEMP_DIR/sample_report.htm_1 sample_report.xls > $TEMP_DIR/sample_report.mail_1
mailx -s "Daily Sample Report" [email protected] < $TEMP_DIR/sample_report.mail_1
有时,邮件中附加的sample_report.xls是空的,零行。
我已经排除了以下情况:
- 不是命令处理超时 -通过将 -t30 添加到 isql,我得到 xls 并且它包含错误,不是空
- 不是 sql 错误 - 通过在 sql 中强制出现错误,我得到 xls 并且它包含错误,不是空
- 不确定登录超时 -通过添加-l1,它不会超时,但我不能指定低于1秒的数字,所以我不能说
我不能重现这个,因为我不知道原因。有其他人经历过这种情况或者有办法解决这个问题吗?有什么建议如何查找原因吗?是unix还是Sybase isql?
Give this unix script, which is scheduled batch run:
isql -U$USR -S$SRVR -P$PWD -w2000 < $SCRIPTS/sample_report.sql > $TEMP_DIR/sample_report.tmp_1
sed 's/-\{3,\}//g' $TEMP_DIR/sample_report.tmp_1 > $TEMP_DIR/sample_report.htm_1
uuencode $TEMP_DIR/sample_report.htm_1 sample_report.xls > $TEMP_DIR/sample_report.mail_1
mailx -s "Daily Sample Report" [email protected] < $TEMP_DIR/sample_report.mail_1
There are occasionally cases where the sample_report.xls attached in the mail, is empty, zero lines.
I have ruled out the following:
- not command processing timeout - by adding the -t30 to isql, I get the xls and it contains the error, not empty
- not sql error - by forcing an error in the sql, I get the xls and it contains the error, not empty
- not sure of login timeout - by adding -l1, it does not timeout, but I can't specify a number lower than 1 second, so I can't say
I cannot reproduce this, as I do not know the cause. Has anyone else experienced this or have way to address this? Any suggestions how to find the cause? Is it the unix or the Sybase isql?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了原因。由于这是已安排的,因此该特定报告需要很长时间才能生成。我发现其他计划脚本有这样一行代码:
如果这个长时间运行的报告与上面一行的计划脚本之一重叠,则 .tmp_1 可能会被删除,因此在邮寄时为空白。当报告仍在其中写入 SQL 时,我通过手动删除 .tmp_1 来复制此内容。
I found the cause. Since this is scheduled, and this particular report takes a long time to generate. Other scheduled scripts, I found have this line of code:
If the this long running report, overlaps with one of the scheduled scripts with the line above, the .tmp_1 can possibly be deleted, hence blank by the time it is mailed. I replicated this by manually deleting the .tmp_1 while the report was still writing the sql in there.