Oralce's Save command

Source: Internet
Author: User

Oralce's Save command

You can use the save () command to save the content of the current buffer to a file. In this way, even if the content in the buffer is overwritten, the syntax of the save command for executing the current statement is retained as follows:

Save [file] file_name [replace | create | append]

File_name indicates that the content of the SQL * PLUS buffer is saved to a file specified by file_name, and create indicates that a file_name file is created and the content in the buffer is saved to the file, this option is the default value. Replace indicates that if file_name already exists, the content of the file_name file will be overwritten; if the file does not exist, the file will be created. Append: If the file_name file already exists, the content in the buffer is appended to the content of the file_name file. If the file does not exist, the file is created.

The specific operations are as follows:

SQL> select * from dept;

DEPTNO DNAME LOC

-------------------------------------

10 ACCOUNTING NEW YORK

20 RESEARCH DALLAS

30 SALES CHICAGO

40 OPERATIONS BOSTON

SQL> save query. SQL

File query has been created. in SQL, a query is found under my D: \ Oracle \ app \ Administrator \ product \ 12.1.0 \ dbhome_1 \ BIN. SQL file with the following content:

Select * from dept

/

If you want to save the result to another place, you can specify the path when creating the result, for example, save e: \ query. the SQL statement is saved in the directory of the E disk. You can also use savee: \ query. SQL replace;

Or save e: \ query. SQL append, which is not described here.

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.