SQL*Plus User's Guide and Reference Release 9.0.1 Part Number A88827-02 |
|
Command Reference, 3 of 52
@{uri|file_name[.ext] } [arg...]
Runs the SQL*Plus statements in the specified command file. The command file can be called from the local file system or from a web server. uri is only supported on Windows platforms in this release.
Refer to the following for a description of the term or clause:
uri
file_name[.ext]
Represents the command file you wish to run. If you omit ext, SQL*Plus assumes the default command-file extension (normally SQL). For information on changing the default extension, see the SUFFIX variable of the SET command in this chapter.
When you enter @ file_name.ext, SQL*Plus searches for a file with the filename and extension you specify in the current default directory. If SQL*Plus does not find such a file, SQL*Plus will search a system-dependent path to find the file. Some operating systems may not support the path search. See the Oracle installation and user's manual(s) provided for your operating system for specific information related to your operating system environment.
arg...
Represent data items you wish to pass to parameters in the command file. If you enter one or more arguments, SQL*Plus substitutes the values into the parameters (&1, &2, and so forth) in the command file. The first argument replaces each occurrence of &1, the second replaces each occurrence of &2, and so forth.
The @ command DEFINEs the parameters with the values of the arguments; if you run the command file again in this session, you can enter new arguments or omit the arguments to use the current values.
For more information on using parameters, refer to the subsection "Passing Parameters through the START Command" under "Writing Interactive Commands" in Chapter 3.
In a command file, you can include any command you would normally enter interactively (typically, SQL, SQL*Plus commands, or PL/SQL blocks).
An EXIT or QUIT command used in a command file terminates SQL*Plus.
The @ command functions similarly to START.
If the START command is disabled (see "Disabling SQL*Plus, SQL, and PL/SQL Commands" in Appendix E, "Security"), this will also disable the @ command. See START in this chapter for information on the START command.
SQL*Plus removes the SQLTERMINATOR (a semicolon by default) before the @ command is issued. If you require a semicolon in your command, add a second SQLTERMINATOR. See the SQLTERMINATOR variable of the SET command in this chapter for more information.
To run a command file named PRINTRPT with the extension SQL, enter
@PRINTRPT
To run a command file named WKRPT with the extension QRY, enter
@WKRPT.QRY
You can run a script named YEAREND specified by a Uniform Resource Indentifier, and pass values to variables referenced in YEAREND in the usual way:
@HTTP://HOST.DOMAIN/YEAREND.SQL VAL1 VAL2 @FTP://HOST.DOMAIN/YEAREND.SQL VAL1 VAL2 @GOPHER://HOST.DOMAIN/YEAREND.SQL VAL1 VAL2
On a web server configured to serve SQL reports, you could request SQL*Plus to execute a dynamic script by using:
@HTTP://HOST.DOMAIN/SCRIPTSERVER?ENDOFYEAR VAL1 VAL2
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|