Le Nguyen The Dat

After a few hours without no luck trying to find the best way to dump Oracle DB's table into CSV with sqlplus, I've came up with my own solution. It might not be the best one, but at least it works for me:

SQL file query.sql:

SET COLSEP '|'SET ECHO OFFSET FEEDBACK OFFSET TERMOUT OFFSET PAGESIZE 32766 -- Maximum number we can set. -- i.e there will be duplication of headers. SET LINESIZE 32766 -- Maximum number we can set.SET NEWPAGE NONESET VERIFY OFFSET TERM OFFSET TRIMS ONSET TRIMSPOOL ONSET UNDERLINE OFF