sqlplus export a table data

Network only allows use of the sql developer of this software is not rubbing, loading data into the line 51 on the black, not law with sqlplus.

Open cmd,

sqlplus user / passwd @ ip: port / library name
set colsep, // output delimiter
set feedback off // number of records echo this sql command processing, the default is ON
the SET OFF // output field heading title, missing Province ON
the SET trimout ON 
spool xxx.csv - here specify the export csv file path and file name
select ' "' || xxxx || ' ", "' || xxxx || '", "' || xxx | | ' "' from tmp; - here specify the export table and field names
spool OFF 
Exit

 

Oracle in the set piecemeal, summarizing it here

 

SQL> set timing on; // set the display "Elapsed Time: XXXX"

SQL> set autotrace on-; // setting allows for analysis of sql execution

SQL> set trimout on; // remove the standard output trailing spaces per line, the default is off

SQL> set trimspool on; // trailing spaces removing redirection (spool) of each output line, the default is off

SQL> set echo on // whether the display is set to run a command statement

SQL> set echo off; // display startup scripts start of each sql command, the default is on

SQL> set feedback on; // set the display "Selected XX line"

SQL> set feedback off; // echo this number sql command processing of records, the default is on

SQL> set colsep ''; // output delimiter

SQL> set heading off; // output field title, the default is on

SQL> set pagesize 0; // number of output lines per page, 24 by default, in order to avoid the tab may be set to 0.

SQL> set linesize 80; // number of output line of characters, default 80

SQL> set numwidth 12; // Output type number field length, default is 10

SQL> set termout off; // display the results of a command script, the default is on

SQL> set serveroutput on; // arrangement allows the display output similar dbms_output

SQL> set verify off // can turn off and turn on the prompt confirmation message is displayed old and new 1 1 of.

Guess you like

Origin www.cnblogs.com/zephyr-1/p/11642250.html