Oracle sqlplus Export Query Results

Source: Internet
Author: User
Tags sqlplus

  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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.