Oracle- tool -SPOOL export data files

    By SPOLL the Oracle data exported as INSERT statement, as long as the export data format can be changed to INSERT format.

set feedback off    
set heading off           
set termout on  
set verify off              
set echo off        
set pagesize 1000
set linesize 100
define filepath= 'f:\1.log'   
prompt *** Spooling to &filepath 
set termout off          
spool &filepath                  
select 'insert into aa(a, b, c) values('''|| a ||''',''' || b || ''',''' || c ||''');' from table_name where 1 = 1;

spool off;

    Of course, you can also export in CSV format for use EXCLE viewing, file extension only need to export the log was changed to csv.

    The above method can be done by third-party tools, but lack of flexibility, using the above command is simple and flexible.

Guess you like

Origin www.cnblogs.com/yangjn/p/11697491.html