'Is there some way to automatically export the query results in PL/SQL Developer? CSV or XLSX for example

I've tried some codes like these below:

select /*csv*/ * from users;

,

spool "C:/Users/Douglas/Desktop";
select /*csv*/ *
  from users;
spool off;

AND

--CSV=C:\Users\dvferreira\Desktop\temp.csv
select * from users;

Is there anything else I can try?

PL/SQL Developer 15.0.0.2050



Solution 1:[1]

Since SQL*Developer shares the same codebase as SQLCl, the SQLCl command SET SQLFORMAT works:

set sqlformat CSV

spool "c:\temp\out.csv"

select * from user_tables;

spool off

Then 'Run As Script'.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TenG