Oracle sql developer spool
REMARK: Due to the algorithm in sqlcl you can force sqlcl to crash with sqlformat ansiconsole if it does not have enough memory to pre-fetch the data for a single page. Looooooooooooooooooooooooooooooooooooooooooooooooooooooong SQL> select owner, oracle_maintained, object_name from t1 where rownum set pagesize 1ģ select 'looooooooooooooooooooooooooooooooooooooooooooooooooooooong' val from dual Table select owner, oracle_maintained, object_name from t1 where rownum column owner format column object_name format select owner, oracle_maintained, object_name from t1 where rownum set sqlformat ansiconsole a query on a table T1 (which is a copy of ALL_OBJECTS) it looks by default as follows and is hard to read: create table t1 as select * from all_objects Most people use tools like SQL Developer or Quest TOAD which can scroll horizontally when running queries against a database, but as a consultant you are often still forced to use sqlplus.
You can't do it with the /*csv*/ directive or sqlformat csv though.Column formatting was always a pain in sqlplus when writing queries on the prompt. If you don't want to set that on each export you can set it as a default, from Tools->Preferences: When you export and choose CSV or delimited format you can choose whether to include the header and which delimiter and enclosures to use - and you're allowed to choose 'none'. Or you can run the query using Run Statement (Ctrl-Enter) and then export the results from the data grid, from the context menu that appears when you right-click on the output. If you really want CSV format without enclosures you can either build up the output manually by concatenating the column(s) with comma literals, which still allows you to spool to a file:
If you have multiple columns or strings that may contain delimiters then the enclosures are useful to stop those delimiters being misinterpreted when opening in Excel or some other external tool. If you are really exporting that one column and don't have delimiters then just leave out the /*csv*/ directive. Using CSV format for a single column seems rather pointless anyway though, unless you have delimiters in your string you want to escape. The slightly more convenient way of doing this now is with the sqlformat command, but even with sqlformat delimited you have to have the string enclosed. You can't get rid of the double-quotes with the /*csv*/ directive.