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