SQLPLUS automatically saves executed SQL

Source: Internet
Author: User

SQLPLUS automatically saves the executed SQL. When learning oracle, it wants to record the executed commands and results. However, it is not a way to use SQLPLUS to save each time. It is quite troublesome to manually execute the spool, so I made a BAT script for SQLPLUS to implement automatic SPOOL to the file. The content of the www.2cto.com script [plain] @ echo off color 0a echo ************ from you can define SQLPLUS *************** echo ***** to automatically output the date format LOG to the specified location ***** echo ****** * ** Created by Cryking ************ echo *************** 2012.12.25 ******** * ****** sqlplus "/as sysdba" @ d: \ script \ autospool. SQL exit -- autospool. the SQL statement is as follows: [SQL] set feedback off set trimspool on set term off column dt1 new_value filename SELECT TO_CHAR (SYSDATE, 'yyyymmdd') dt1 FROM DUAL; SPOOL D: \ exercise \ study & filename .. txt append runs the script every time to start SQLPLUS, so you don't need to manually SPOOL every time.
 

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.