SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

@@ (double "at" sign)

Purpose

Runs a nested command file. This command is identical to the @ ("at" sign) command except that it looks for the specified command file in the same path as the command file from which it was called.

Syntax

@@ file_name[.ext]

Terms and Clauses

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

file_name[.ext] Represents the nested 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 from within a command file, SQL*Plus runs file_name.ext from the same directory as the command file. When you enter @@file_name.ext interactively, SQL*Plus runs file_name.ext from the current working directory. If SQL*Plus does not find such a file, SQL*Plus searches 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.
Usage Notes

You can include in a command file any command you would normally enter interactively (typically, SQL or SQL*Plus commands).

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, this will also disable the @@ command. See START in this chapter for further information on the START command.

SQL*Plus removes the SQLTERMINATOR (a semicolon by default) before the @@ command is issued. A workaround for this is to add another SQLTERMINATOR. See the SQLTERMINATOR variable of the SET command in this chapter for more information.

Example

Suppose that you have the following command filenamed PRINTRPT:

SELECT * FROM EMP
@EMPRPT
@@ WKRPT

When you START PRINTRPT and it reaches the @ command, it looks for the command filenamed EMPRPT in the current working directory and runs it. When PRINTRPT reaches the @@ command, it looks for the command filenamed WKRPT in the same path as PRINTRPT and runs it.


Contents Index Home Previous Next