DEV Community

Mark Sta Ana
Mark Sta Ana

Posted on • Originally published at booyaa.wtf on

SQL Developer's new format hints

One of my favourite cool features in SQL Developer is the ability to turn a sql query output into an entirely different format. It doesn't even require breaking out the import/export wizard.

SPOOL C:\TEMP\foobar.csv

SELECT /*csv*/ *
  FROM foo
  LEFT
  JOIN bar
    ON foo.id = bar.id
 WHERE foo.name LIKE '%HURR%';

 SPOOL OFF
Enter fullscreen mode Exit fullscreen mode

Complete list of formats

SELECT /*csv*/ * FROM scott.emp;
SELECT /*xml*/ * FROM scott.emp;
SELECT /*html*/ * FROM scott.emp;
SELECT /*delimited*/ * FROM scott.emp;
SELECT /*insert*/ * FROM scott.emp;
SELECT /*loader*/ * FROM scott.emp;
SELECT /*fixed*/ * FROM scott.emp;
SELECT /*text*/ * FROM scott.emp;
Enter fullscreen mode Exit fullscreen mode

Full details and source can be here.

Top comments (0)