我有一个查询,它生成特定日期的报告。在Oracle中导出到excel中有什么查询吗?我不想手动导出它。我正在使用oracle developer。
发布于 2019-09-25 20:10:30
您需要使用SPOOL
,并且不能直接写入.xls
文件,您需要将数据写入.csv
文件并在Excel
中打开。
set sqlformat csv
spool d:\your_file.csv
select * from your_table;
spool off;
干杯!!
发布于 2019-09-25 20:57:50
如果您使用的是Oracle SQL devloper:
在Oracle SQL Developer中将查询输出导出到Excel,而不进行假脱机:
Step 1: Run your query. To start, you'll need to run your query in SQL Developer. ...
Step 2: Open the Export Wizard. ...
Step 3: Select the Excel format and the location to export your file. ...
Step 4: Export the query output to Excel.
例如:
如果您没有使用向导,那么另一种方法是使用以下命令:
@export on;
@export set CsvColumnDelimiter=";";
@export set ShowNullAs="";
@export set filename="/home/xxx.csv";
select * from XX_TABLE;
@export off;
https://stackoverflow.com/questions/58097660
复制相似问题