iSQL*Plus User's Guide and Reference Release 9.0.1 Part Number A88826-01 |
|
Command Reference, 31 of 38
STA[RT] {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. Only the uri form is supported in iSQL*Plus.
Refer to the following list for a description of each term or clause:
uri
file_name[.ext]
Represents the command file you wish to execute. The file can contain any command that you can run interactively.
If you do not specify an extension, SQL*Plus assumes the default command-file extension (normally SQL).
When you enter START 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. Consult 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 START command DEFINEs the parameters with the values of the arguments; if you START the command file again in this session, you can enter new arguments or omit the arguments to use the old values.
The @ ("at" sign) and @@ (double "at" sign) commands function similarly to START. Disabling the START command in the Product User Profile also disables the @ and @@ commands. See the @ ("at" sign) and @@ (double "at" sign) commands in this chapter for further information on these commands.
A file named PROMOTE with the extension SQL, used to promote employees, might contain the following command:
SELECT FIRST_NAME, LAST_NAME, JOB_ID, SALARY FROM EMP_DETAILS_VIEW WHERE JOB_ID='&1' AND SALARY>&2;
To run this command file, enter
START PROMOTE ST_MAN 7000
or if it is located on a web server, enter a command in the form:
START HTTP://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000 START FTP://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000 START GOPHER://HOST.DOMAIN/PROMOTE.SQL ST_MAN 7000
Where HOST.DOMAIN must be replaced by the host.domain name for the web server where the script is located.
In either case, SQL*Plus then executes the following command:
SELECT LAST_NAME, LAST_NAME FROM EMP_DETAILS_VIEW WHERE JOB_ID='ST_MAN' AND SALARY>7000;
and displays the results in SQL*Plus.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|