Get the App
SLTechnology News&Howtos  ›  Database  › 

Spool command about oracle

Shulou Source: shulou.com Published: 2022-06-01 06:35:47 10月01日 Update

Use the spool command to copy the results of the output in sql*plus to a specified file, or to copy the results of the query

Send it to the printer until you use the spool off command directly.

The syntax of the spool command is:

Spool [file_name [create | replace | append] off | out]

Where file_name specifies an operating system file

Create will create a specified file_name file

Replace replaces the specified file if it already exists

Append appends the content to an existing file

Off stops copying the output from sql*plus to the file_name file and closes the file.

Out starts this function to copy the output structure from sql*plus to file_name.

Examples are as follows:

Then go to the contents of the a.sql file under / home/oracle

Tags: File command result output content function instance printer system structure syntax query attach Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker OPPO Reno NVidia Redmi