Record your actions and results in the SQLPLUS environment

zhaozj2021-02-12  157

Contact your author: xiaozuidaizhi@sina.com

You need to use the following command: SPOOL file name. File suffix A series of operations and operation results Spool Off This can store the results of the statement and operation of the operation in the form of the text in its own form. File - "File Name. File Format" This file is saved in the IF OS IS Linux Then User Directory IF OS WINDOWS THEN SYSDIR / Documents and Settings / User Directory

-------------------------------------------------- ------------------------------------------ Spool is the establishment of channels, and File name and format

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

Next, an example statement: Establish a database in a database to delete files

Spool DROPTABLES.SQL

SELECT 'DROP TABLE' || Table_name || 'Cascade Constraints;' from User_Tables;

spool off

"||" is a connecting, and is accepted by the SQL syntax in Oracle, the above SQL statement is used with || Connect the string 'drop table' and string 'cascade constraints;', of course, also connected to the table name Table_name; then, you can find this SQL file in the corresponding directory, after you need to delete a large table, you can establish such a file, of course, if you want to record your other operations and results, you can do this. .

转载请注明原文地址:https://www.9cbs.com/read-6169.html

New Post(0)