且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Oracle SQL Developer中将查询结果导出到csv?

更新时间:2022-10-16 21:46:43

strong>





2012年5月5日更新



Jeff Smith 博客显示,我相信是从SQL Developer获得CSV输出的高级方法。 Jeff的方法如以下方法1所示:



方法1



注释 / * csv * / 到您的SQL查询,并作为脚本运行查询(使用F5或工作表工具栏上的第二个执行按钮)





$ p
$ b

方法2





右键点击并选择卸载。



在Sql Developer版本3.0.04卸载已更改为导出
感谢Janis Peisenieks指出了这一点





修订了SQL Developer 3.0.04版的屏幕截图



/ p>

从格式下拉菜单中选择CSV





按照屏幕上的其余说明进行操作。 / strong>


I'm using Oracle SQL Developer 3.0. Trying to figure out how to export a query result to a text file (preferably CSV). Right clicking on the query results window doesn't give me any export options.

Version I am using

Update 5th May 2012

Jeff Smith has blogged showing, what I believe is the superior method to get CSV output from SQL Developer. Jeff's method is shown as Method 1 below:

Method 1

Add the comment /*csv*/ to your SQL query and run the query as a script (using F5 or the 2nd execution button on the worksheet toolbar)

That's it.

Method 2

Run a query

Right click and select unload.

Update. In Sql Developer Version 3.0.04 unload has been changed to export Thanks to Janis Peisenieks for pointing this out

Revised screen shot for SQL Developer Version 3.0.04

From the format drop down select CSV

And follow the rest of the on screen instructions.