ITPub博客

首页 > 数据库 > 数据库开发技术 > How to export data from Teradata DB into csv file

How to export data from Teradata DB into csv file

原创 数据库开发技术 作者:cunny 时间:2007-01-08 05:00:40 0 删除 编辑

Today I read the following entry level teradata guide (

.show controls

it is a command to show the output control parameter for BTEQ. I summerized the original knowledge and got the following script to export the query results into csv from teradata database.

[@more@]

Create a file name test.in and under the dos prompt, run bteq < test.in

.set session transaction btet;
.logon prod/user_id, password

select current_time;
.set defaults
.set separator ","
.set width 600
.set format on
.EXPORT report FILE= e:temptest3.txt

SELECT * FROM vsym_prod;

.EXPORT RESET;
select current_time;
.logoff
.exit

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/82/viewspace-889085/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 做客老胡家
请登录后发表评论 登录
全部评论
  • 博文量
    90
  • 访问量
    2058776