Created
January 18, 2018 15:54
-
-
Save ricklentz/28a2981cafe06a7ed2d2710e2b92044b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: START BAT FILE | |
sqlplus username/password@host:port/service -i @run.sql | |
:: END BAT FILE | |
--START SQL FILE run.sql | |
SET VERIFY OFF; | |
SET FEEDBACK OFF | |
SET TERMOUT OFF | |
SET PAGESIZE 0 | |
SET HEADING OFF | |
SET COLSEP "," | |
SET LINESIZE 32767 | |
SET TRIMSPOOL ON | |
SPOOL \\path\to\results.csv | |
-- WRITE HEADER TO FILE | |
SELECT '"a"' | |
||','|| '"b"' as optional_header_row from dual; | |
Select * from dual; | |
SPOOL OFF | |
SET TERMOUT ON | |
prompt *********** Finished CSV *********** | |
SET HEADING ON | |
SET FEEDBACK ON | |
SET VERIFY ON; | |
--END SQL FILE run.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment