Execute the SQL script file: @ and @

Source: Internet
Author: User

Execute an SQL script file

SQL> Start file_name

SQL> @ file_name

We can save multiple SQL statements in a text file, so that when we want to execute all the SQL statements in this file, we can use any of the following commands, which is similar to batch processing in DOS.

What is the difference between @ and?

@ Equals to the start command, used to run an SQL script file.

@ Command to call the script file in the current directory, or specify the full path, or you can use the sqlpath environment variable to search for the script file. This command is generally used to specify the full path of the file to be executed, otherwise the specified file is read from the default path (specified by the sqlpath variable.

@ Is used in the SQL script file to indicate that the SQL script file executed with @ is in the same directory as the file where @ is located, instead of specifying the full path of the SQL script file to be executed, or finding the SQL script file from the path specified by the sqlpath environment variable, this command is generally used in the script file.

For example, in the C: \ Temp directory, the start. SQL and nest_start. SQL files and the start. SQL script files are as follows:

@ Nest_start. SQL--equivalent to @ C: \ temp \ nest_start. SQL

In SQL * Plus, run the following command:

SQL> @ C: \ temp \ Start. SQL

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.