Teradata BTEQ导出脚本导致O / P文件中的无效字符

时间:2013-03-26 09:14:31

标签: teradata

这是我简单的BTEQ脚本

.LOGON 127.0.0.1/tduser,tduser
.EXPORT DATA FILE=C:\Documents and Settings\Owner\Desktop\Study\Google Drive\TD\BTEQ\Exported_File.txt
    SELECT      account_number
    FROM    samples.accounts
    WHERE   balance_current  < 500 ;
.EXPORT RESET
.QUIT

=============================================== ======================================

脚本的输出:

BTEQ 12.00.00.01 Tue Mar 26 19:58:59 2013

+---------+---------+---------+---------+---------+---------+---------+----
.LOGON 127.0.0.1/tduser,

 *** Logon successfully completed.
 *** Teradata Database Release is 12.00.00.10
 *** Teradata Database Version is 12.00.00.10
 *** Transaction Semantics are BTET.
 *** Character Set Name is 'ASCII'.

 *** Total elapsed time was 1 second.

+---------+---------+---------+---------+---------+---------+---------+----
.EXPORT DATA FILE=C:\Documents and Settings\Owner\Desktop\Study\Google Driv
e\TD\BTEQ\Exported_File.txt
 *** To reset export, type .EXPORT RESET
+---------+---------+---------+---------+---------+---------+---------+----
 SELECT   account_number
 FROM  samples.accounts
 WHERE  balance_current  < 500 ;

 *** Success, Stmt# 1 ActivityCount = 4
 *** Query completed. 4 rows found. One column returned.
 *** Total elapsed time was 1 second.


+---------+---------+---------+---------+---------+---------+---------+----
.EXPORT RESET
 *** Output returned to console.
+---------+---------+---------+---------+---------+---------+---------+----
.QUIT
 *** You are now logged off from the DBC.
 *** Exiting BTEQ...
 *** RC (return code) = 0

=============================================== ======================================

一次,我检查文件在文本文件中显示无效字符。任何可能的解决方法? Unicode问题?我不确定。我甚至尝试粘贴下面的文件内容,但它是空的。  
 
 
    

提前致谢。

3 个答案:

答案 0 :(得分:1)

请使用以下命令导出bteq:

.EXPORT REPORT FILE = filename ...

我遇到了与数据文件相同的问题。改变之后,它起作用了。

答案 1 :(得分:0)

请尝试将文件名用双引号括起来,因为实际文件的路径中有空格。

<强>原始

.EXPORT DATA FILE=C:\Documents and Settings\Owner\Desktop\Study\Google Drive\TD\BTEQ\Exported_File.txt

<强>修

.EXPORT DATA FILE="C:\Documents and Settings\Owner\Desktop\Study\Google Drive\TD\BTEQ\Exported_File.txt"

答案 2 :(得分:-1)

更改如下..

.EXPORT REPORT FILE = filename ...