Oracle data can be exported to a text file using the spool buffer pool technology in Oracle.
1, enter the buffer start command in Oracle Pl/sql, and specify the file name of the output:
Spool D:\output.txt
2, enter your SQL query at the command line:
Select Mobile from Customer;
Select mobile from client;
......
3), enter the buffer result command at the command line:
Spool off;
The system outputs the results from the buffer pool to the "output.txt" file.
tab-delimited example (syoyou_xamshain.sql file)
Set NewPage 0
Set Linesize 10000
Set pagesize 0
Set und Off
Set Trimspool on
Set COLSEP,
Set echo off
Set Feedback off
Spool Syoyou_xamshain.csv
Select
SHIMEI_CD, Valid_term_start_ymd, Shain_nmj_sei, Shain_nmj_na, Shain_nmhk_sei,
Shain_nmhk_na, Shain_nmhe_sei, Shain_nmhe_middle, Shain_nmhe_na, SEI_BETSU_KBN,
nok00j0001. NOZJ1301 (Birth_day),
Saiyou_ymd, KEI_BETSU_CD, Retire_ymd, BANK_CD, BANK_NMJ, BANK_NMK, BANK_SHITEN_CD,
BANK_SHITEN_NMJ, BANK_SHITEN_NMK, Yokin_type, Kouza_meigi_kana,
nok00j0001. NOZJ1301 (Kouza_no), SSO_TAISHO_FLG,
Valid_term_end_ymd, NEXT_SYSTEM_TAISHO_FLG, IDOU_FLG, YUUKOU_FLG, CREATE_USER_CD,
Create_time_stamp, UPDATE_USER_CD, Update_time_stamp
From Xamshain;
Spool off