Oracle sqlplus Export Query Results
The results of exporting a query under Sqlplus are saved to a local SQL file, which can be used in the following ways:
1. Connect database : sqlplus xmq/[email protected]:1521/DB2, Export SQL Script : set Feedback off -- echo The number of record bars processed by this SQL command, default to on set pagesize 0 -- Output per page line, default is 24, set to 0 means no paging set long 90000 spool C:/schema.sql --Output file path, Can be either full path or relative path select col1 from table1; --Execute query spool off
" related properties ":
set echo off --does not display executed SQL statements
set Feedback off --does not display rows of xx rows selected
set heading off --No table header displayed
set Termout off --does not show script run results
set Trimspool on--Remove the space at the end of the script output line
Set pagesize 0 --sets PageSize to zero, does not allow Oracle to be paged
Set linesize 10000 --Sets the maximum number of columns per row
Set colsep ' --sets the delimiter between columns
Oracle sqlplus Export Query Results