oracle的Spool命令

來源:互聯網
上載者:User

標籤:oracle的spool命令

使用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中如下的操作

在我的端腦e盤中找到query.sql檔案,代開該檔案,檔案的內容如下:


該檔案不僅記錄的你查詢的結果的資訊,同時也記錄了你的查詢的語句。

oracle的Spool命令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.