Brug derefter SQL*Plus kommandoer og generer dit ønskede output. Det handler om formatering outputtet.
- SQL*Plus
For eksempel,
SQL> SET colsep ,
SQL> SET pagesize 20
SQL> SET trimspool ON
SQL> SET linesize 200
SQL> SELECT * FROM hr.employees WHERE ROWNUM <=10;
EMPLOYEE_ID,FIRST_NAME ,LAST_NAME ,EMAIL ,PHONE_NUMBER ,HIRE_DATE,JOB_ID , SALARY,COMMISSION_PCT,MANAGER_ID,DEPARTMENT_ID
-----------,--------------------,-------------------------,-------------------------,--------------------,---------,----------,----------,--------------,----------,-------------
100,Steven ,King ,SKING ,515.123.4567 ,17-JUN-03,AD_PRES , 24000, , , 90
101,Neena ,Kochhar ,NKOCHHAR ,515.123.4568 ,21-SEP-05,AD_VP , 17000, , 100, 90
102,Lex ,De Haan ,LDEHAAN ,515.123.4569 ,13-JAN-01,AD_VP , 17000, , 100, 90
103,Alexander ,Hunold ,AHUNOLD ,590.423.4567 ,03-JAN-06,IT_PROG , 9000, , 102, 60
104,Bruce ,Ernst ,BERNST ,590.423.4568 ,21-MAY-07,IT_PROG , 6000, , 103, 60
105,David ,Austin ,DAUSTIN ,590.423.4569 ,25-JUN-05,IT_PROG , 4800, , 103, 60
106,Valli ,Pataballa ,VPATABAL ,590.423.4560 ,05-FEB-06,IT_PROG , 4800, , 103, 60
107,Diana ,Lorentz ,DLORENTZ ,590.423.5567 ,07-FEB-07,IT_PROG , 4200, , 103, 60
108,Nancy ,Greenberg ,NGREENBE ,515.124.4569 ,17-AUG-02,FI_MGR , 12008, , 101, 100
109,Daniel ,Faviet ,DFAVIET ,515.124.4169 ,16-AUG-02,FI_ACCOUNT, 9000, , 108, 100
10 rows selected.
SQL>
- SQL-udviklerversion før 4.1
Alternativt kan du bruge den nye /*csv*/
tip i SQL-udvikler .
/*csv*/
For eksempel i min SQL Developer Version 3.2.20.10 :
- SQL-udviklerversion 4.1
Ny i SQL Developer version 4.1, brug følgende ligesom sqlplus kommando og kør som script. Intet behov for tippet i forespørgslen.
SET SQLFORMAT csv