将数据从Oracle SQL Developer导出到Excel .xlsx

我有一个小型项目,需要将Oracel SLQ Developer的数据导出到Excel(使用SLQ Developer中的命令而不是工具),然后创build一个图表。 使用“假脱机”我可以导出到CSV精细(但无法在CSV中创build一个graphics),但是当我尝试导出到XLSX它腐败整个Excel表格说

"Excel cannot open the file "ExcelFile.xlsx" because the file format or file extention is not valid. Verify that the file has not been corrupted and that the file extension mathces the format of the file." 

这里是我在SQL Developer中使用的代码。

 spool FileLocation\ExcelFile.xlsm SELECT * FROM Table; spool off; 

有什么办法可以阻止数据被破坏或有另一种方式将数据导出到.xlsx文件?

谢谢

您好sql开发者从我知道出口是使用sqlplus(代码是一样的),所以perhabs还有其他的方法,但这一个应该是足够好

我会尝试改变第一行看起来像这样:

 spool ExcelFile.xls 

可能你也需要打开

 SET MARKUP HTML ON 

http://www.orahow.com/2015/09/spool-sqlplus-output-to-excel-format.html

无论如何有解决方法 – 您可以生成.CSV文件,然后在Excel中打开它并保存为.xlsx文件

Nooooooo。

 set sqlformat csv spool c:\file.sql select * from table; spool off; 

然后在Excel中打开文件。

要么

以交互方式运行您的查询。

右键单击网格,导出> XLSX。 打开文件。

假脱机只将查询输出写入文件,它不会查看文件扩展名并找出如何在该点编写输出。

所以你要么通过查询自己编码,要么使用我们支持的格式输出之一

 SET SQLFORMAT CSV JSON DELIMITED XML HTML INSERT LOADER 

使用“help set sqlformat”获取帮助。