简体   繁体   English

如何在 oracle 12.1 中使用 sqlplus 将表数据导出到 csv 文件中

[英]How export a table data into a csv file using sqlplus in oracle 12.1

I need a extact the output of one of select which having more than 200 millions records.我需要一个拥有超过 2 亿条记录的 select 之一的 output。 So what is the way doing such unload.那么这种卸载的方法是什么。 I can access the DB server via sqlplus.我可以通过 sqlplus 访问数据库服务器。 I search through the internet and I found below commands.我在互联网上搜索,发现以下命令。 But seems they are not working 12.1但似乎他们不工作 12.1

SQL> set markup csv on
SP2-0158: unknown SET option "csv"
SQL>

You can use the您可以使用

set colsep ,
set pagesize 0
set lines 1000

colsep is the separator character used to split the columns. colsep是用于拆分列的分隔符。 For a.csv file, It should be comma.对于 a.csv 文件,它应该是逗号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM