我有一个小项目,需要将 Oracle SQL Developer 中的数据导出到 Excel(使用命令而不是 SLQ Developer 中的工具),然后创建一个图表。使用“spool”我可以很好地导出到 csv(但不能在 csv 中制作图表)但是当我尝试导出到 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 文件?
原文由 IAmRapson 发布,翻译遵循 CC BY-SA 4.0 许可协议
我也遇到了同样的问题,然后在代码下面应用它并成功导出..