SQL*Plus User's Guide and Reference
Release 8.1.5

A66736-01

Library

Product

Contents

Index

Prev Up Next

Command Reference, 44 of 52


START

Purpose

Executes the contents of the specified command file.

Syntax

STA[RT] file_name[.ext] [arg ...]

Terms and Clauses

Refer to the following list for a description of each term or clause:

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). For information on changing this default extension, see the SUFFIX variable of the SET command in this chapter.

      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.

      For more information on using parameters, refer to the subsection "Passing Parameters through the START Command" under "Writing Interactive Commands" in Chapter 3.

Usage Notes

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 @ and @@ commands in this chapter for further information on these commands.

The EXIT or QUIT commands in a command file terminate SQL*Plus.

Example

A file named PROMOTE with the extension SQL, used to promote employees, might contain the following command:

SELECT * FROM EMP
WHERE MGR=&1 AND JOB='&2' AND SAL>&3;

To run this command file, enter

SQL> START PROMOTE 7280 CLERK 950

SQL*Plus then executes the following command:

SELECT * FROM EMP
WHERE MGR=7280 AND JOB='CLERK' AND SAL>950;


Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index