(1)When you enter @file_name.ext, SQL*Plus searches for a file with that filename and extension in the current default directory. If SQL*Plus does not find the file in the current directory, it searches a system-dependent path to find it. Some operating systems may not support the path search. See the platform-specific Oracle documentation provided for your operating system for specific information related to your operating system environment.
(2)When you enter @@file_name.ext from within a script, SQL*Plus runs file_name.ext from the same directory as the script.
When you enter @@file_name.ext interactively, SQL*Plus runs file_name.ext from the current working directory or from the same url as the script. from which it was called.If SQL*Plus does not find the file, it searches a system-dependent path to find the file.Some operating systems may not support the path search. See the platform-specific Oracle documentation provided for your operating system for specific information related to your operating system environment.
Examples
Suppose that you have the following script. named PRINTRPT:
SELECT DEPARTMENT_ID, CITY FROM EMP_DETAILS_VIEW WHERE SALARY>12000;
@EMPRPT.SQL
@@ WKRPT.SQL
When you START PRINTRPT and it reaches the @ command, it looks for the script. named EMPRPT in the current working directory and runs it. When PRINTRPT reaches the @@ command, it looks for the script. named WKRPT in the same path as PRINTRPT and runs it.
Suppose that the same script. PRINTRPT was located on a web server and you ran it with START HTTP://machine_name.domain:port/PRINTRPT. When it reaches the @ command, it looks for the script. named EMPRPT in the current working directory and runs it. When PRINTRPT reaches the @@ command, it looks for the script. named WKRPT in the same url as PRINTRPT, HTTP://machine_name.domain:port/WKRPT.SQL and runs it.
Reference:
SQL*Plus®
User’s Guide and Reference
Release 11.1
B31189-01
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13940/viewspace-612648/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/13940/viewspace-612648/