Утилита Oracle SQLcl (исполняемый файл командной строки sql
или sql.exe
) может помочь вам достичь этого.
Вот ссылка для загрузки SQLcl .Это бесплатно.
Чтобы экспортировать файл в формате CSV, вы можете просто указать
SET SQLFORMAT CSV
Если вы хотите использовать другой разделитель, используйте
SET SQLFORMAT DELIMITED '|'
Вот пример выходных данных с заголовком
SQL> select * from employees;
"EMPLOYEE_ID","FIRST_NAME","LAST_NAME","EMAIL","PHONE_NUMBER","HIRE_DATE","JOB_ID","SALARY","COMMISSION_PCT","MANAGER_ID","DEPARTMENT_ID"
198,"Donald","OConnell","DOCONNEL","650.507.9833",21-06-07,"SH_CLERK",2600,,124,50
199,"Douglas","Grant","DGRANT","650.507.9844",13-01-08,"SH_CLERK",2600,,124,50
200,"Jennifer","Whalen","JWHALEN","515.123.4444",17-09-03,"AD_ASST",4400,,101,10
201,"Michael","Hartstein","MHARTSTE","515.123.5555",17-02-04,"MK_MAN",13000,,100,20
202,"Pat","Fay","PFAY","603.123.6666",17-08-05,"MK_REP",6000,,201,20
203,"Susan","Mavris","SMAVRIS","515.123.7777",07-06-02,"HR_REP",6500,,101,40
204,"Hermann","Baer","HBAER","515.123.8888",07-06-02,"PR_REP",10000,,101,70
205,"Shelley","Higgins","SHIGGINS","515.123.8080",07-06-02,"AC_MGR",12008,,101,110
206,"William","Gietz","WGIETZ","515.123.8181",07-06-02,"AC_ACCOUNT",8300,,205,110
100,"Steven","King","SKING","515.123.4567",17-06-03,"AD_PRES",24000,,,90
101,"Neena","Kochhar","NKOCHHAR","515.123.4568",21-09-05,"AD_VP",17000,,100,90
102,"Lex","De Haan","LDEHAAN","515.123.4569",13-01-01,"AD_VP",17000,,100,90
103,"Alexander","Hunold","AHUNOLD","590.423.4567",03-01-06,"IT_PROG",9000,,102,60
104,"Bruce","Ernst","BERNST","590.423.4568",21-05-07,"IT_PROG",6000,,103,60
105,"David","Austin","DAUSTIN","590.423.4569",25-06-05,"IT_PROG",4800,,103,60
106,"Valli","Pataballa","VPATABAL","590.423.4560",05-02-06,"IT_PROG",4800,,103,60
107,"Diana","Lorentz","DLORENTZ","590.423.5567",07-02-07,"IT_PROG",4200,,103,60
108,"Nancy","Greenberg","NGREENBE","515.124.4569",17-08-02,"FI_MGR",12008,,101,100
109,"Daniel","Faviet","DFAVIET","515.124.4169",16-08-02,"FI_ACCOUNT",9000,,108,100
Кроме того, поддерживаются все команды SQL * Plus, кроме нескольких, более специфичных для SQLcl.См. справочник по командной строке