Bat Oracle SQL

Source: Internet
Author: User

Create two BAT files, create_all.bat and create_all_file.bat. The details are as follows:

Create_all.bat
Echo off
Set the following content for REM.
Rem set driver = D:
Rem set filepath = D:/mywork/SQL/
Set user_id = Andy
Set user_pwd = Andy
Set servername = andyserver
Set hostname = 172.23.9.27
Set dbname = Andy

Set next = ------------------------------------------
Set commandstr = iSQL-U % user_id %
Set commandstr = % commandstr %-P % user_pwd %
Set commandstr = % commandstr %-S % servername %
Set commandstr = % commandstr %-H % hostname %
Set commandstr = % commandstr %-D % dbname %
Set commandstr = % commandstr %-I % filepath %

REM % driver %
Rem cd % filepath %
Rem executes all SQL files in the specified directory
For % I in (*. SQL) Do call create_all_file.bat % I
The echo SQL file is executed successfully. Check the preceding execution result.
Pause

----------------------------------------------------------------
Create_all_file.bat
Set filename = % 1
Echo % 1
Set commandstrtb = % commandstr % filename %
Echo % commandstrtb %
% Commandstrtb %
Echo.
Echo % Next %

Usage:
1. Copy the preceding two files to the directory containing the SQL file;
2. Double-click the create_all.bat file.

 

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.