Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Oracle database 12cR2 New Feature -Spool CSV

$
0
0
Oracle database 12CR2 New Feature -Spool CSV
****************************************

Syntax

CSV {ON|OFF} [DELIMI[TER] character] [QUOTE {ON|OFF}]

Traditionally you wiill get formatted output (without CSV)  as below.

SQL> conn system/oracle@orclpdb
Connected.

SQL> select ename,job from emp where rownum < 10;

ENAME  JOB
---------- ---------
KING  PRESIDENT
BLAKE  MANAGER
CLARK  MANAGER
JONES  MANAGER
SCOTT  ANALYST
FORD  ANALYST
SMITH  CLERK
ALLEN  SALESMAN
WARD  SALESMAN

9 rows selected.

New CSV Format.

SQL> SET MARKUP CSV ON

SQL> select ename,job from emp where rownum < 10;

"ENAME","JOB"
"KING","PRESIDENT"
"BLAKE","MANAGER"
"CLARK","MANAGER"
"JONES","MANAGER"
"SCOTT","ANALYST"
"FORD","ANALYST"
"SMITH","CLERK"
"ALLEN","SALESMAN"
"WARD","SALESMAN"

9 rows selected.


So Now in 12.2 you can spool as csv and open in excel sheet


Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>