BTEQ:在日志文件中保存 Teradata 错误

编程入门 行业动态 更新时间:2024-10-28 06:29:13
本文介绍了BTEQ:在日志文件中保存 Teradata 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我的目标是通过 BTEQ 自动将 SQL 脚本部署到 Teradata.到目前为止,我的脚本正在运行.但是,我想生成一个日志文件来捕获可能的故障.

My goal is to automate a deployment of SQL scripts to Teradata via BTEQ. So far my script is working. However, I would like to generate a log file where possible failures are captured.

.LOGON tdserver/username,pw
.EXPORT file=\logfile.txt;

.run file = \Desktop\test\test.sql;

.LOGOFF
.EXIT

我的 SQL 脚本将创建一个视图.例如,当此视图已存在时,我会在 BTEQ 命令窗口中看到错误:

My SQL script will create a VIEW. When this view for example already exists I see an error in the BTEQ command window:

*** 失败 3804 View 'ViewName' 已经存在.

*** Failure 3804 View 'ViewName' already exists.

我希望在我的日志文件中包含此 TD 消息.我尝试了几次,一直在寻找 3 个小时,但不幸的是没有成功.

I would like to have this TD Message in my log file. I tried several tings, have been looking for 3 hours but unfortunately without success.

推荐答案

您可能想尝试使用 .SET ERROROUT STDERR 将错误流重新路由到 STDERR 输出文件而不是默认值将错误流路由到 STDOUT 的操作.

You may want to experiment using .SET ERROROUT STDERR which re-routes the error stream to the STDERR output file instead of the default action of routing the error stream to STDOUT.

BTEQ 手册的第 5 章 - BTEQ 命令中有更多信息.

There is more information in the BTEQ manual under Chapter 5 - BTEQ Commands.

这篇关于BTEQ:在日志文件中保存 Teradata 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 00:24:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1401816.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   文件   日志   BTEQ   Teradata

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!