Home > Database > Mysql Tutorial > body text

Oracle的Spool命令

WBOY
Release: 2016-06-07 16:08:14
Original
1895 people have browsed it

使用Oracle spool命令实行将sql*plus中的输出的结果复制到一个指定的文件中,或者把查询的结果发送到打印机中,直接使用spool of

使用Oracle spool命令实行将sql*plus中的输出的结果复制到一个指定的文件中,或者把查询的结果发送到打印机中,直接使用spool off命令为止。

spool命令的语法如下:
spool [file_name [create|replace|append] off|out]

其中file_name指定一个操作系统文件

create将创建一个指定的file_name文件
replace如果指定的文件已经存在,则替换该文件
append将内容附加到一个已经存在的文件中
off停止将sql*plus中的输出结果复制到file_name文件中,并关闭该文件。
out启动该功能,将sql*plus中的输出结构复制到file_name中。

实例如下:

在我的电脑e盘中不存在query.sql文件

在sql*plus中如下的操作

Oracle的Spool命令

在我的端脑e盘中找到query.sql文件,代开该文件,文件的内容如下:

Oracle的Spool命令


该文件不仅记录的你查询的结果的信息,同时也记录了你的查询的语句。

本文永久更新链接地址:

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!