如何将标题行添加到通过Teradata Aster act创建的文件中?

时间:2016-04-15 23:05:33

标签: header teradata act aster

我已使用以下语法将Teradata Aster中的表格导出到csv文件中:

\o file_name.csv
COPY table_name TO STDOUT WITH DELIMITER ',';
\o
\install file_name.csv

此代码使用从Aster表导出的数据创建csv。但是,它不包含标题行。数据足够大,通过Teradata Studio Express导出不可行。目前,我的解决方案是在文本编辑器帖子COPY中手动插入标题。我想知道是否有办法在行动中做到这一点?

1 个答案:

答案 0 :(得分:0)

当您第一次登录ACT时,您会看到一个欢迎屏幕:

Welcome to act 06.00.00.02, the Aster nCluster Terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with act commands
       \g or terminate with semicolon to execute query
       \q to quit

您可以使用\h COPY查找COPY功能的文档。像这样:

Command:     COPY
Description: copy data between a file and a table
Syntax:
COPY tablename [ ( column [, ...] ) ]
    FROM STDIN
    [ [ WITH ]
          [ DELIMITER [ AS ] 'delimiter' ]
          [ NULL [ AS ] 'null string' ]
          [ CSV [ QUOTE [ AS ] 'quote' ]
                [ ESCAPE [ AS ] 'escape' ] ] ]
    [ LOG ERRORS
      [ [ INTO errortablename ] [ WITH LABEL [ AS ] 'label' ] | NOWHERE ]
      [ ERRORLIMIT [ AS ] limit ]
    ]

COPY tablename [ ( column [, ...] ) ]
    TO STDOUT
    [ [ WITH ]
          [ DELIMITER [ AS ] 'delimiter' ]
          [ NULL [ AS ] 'null string' ]
          [ CSV [ QUOTE [ AS ] 'quote' ]
                [ ESCAPE [ AS ] 'escape' ] ] ]

此处没有用标题复制的选项。因此,我认为您可能必须在复制后添加标题。