EDIT

From InterBase
Jump to: navigation, search

Go Up to isql Command Reference


Allows editing and re-execution of isql commands.

EDIT [filename];
Argument Description

<filename>

Name of the file to edit

Description: The EDIT command enables you to edit commands in:

  • A source file and then execute the commands upon exiting the editor.
  • The current isql session, then re-execute them.

On Windows platforms, EDIT calls the text editor specified by the EDITOR environment variable. If this environment variable is not defined, then EDIT uses the Microsoft Notepad editor.

On UNIX, EDIT calls the text editor specified by either the VISUAL environment variable or EDITOR, in that order. If neither variable is defined, then EDIT uses the vi editor.

If given filename as an argument, EDIT places the contents of filename in an edit buffer. If no file name is given, EDIT places the commands in the current isql session in the edit buffer.

After exiting the editor, isql automatically executes the commands in the edit buffer.

Filenames with spaces You can optionally delimit the filename with double or single quotes. This allows you to use filenames with spaces in EDIT statements.

Examples: To edit the commands in a file called start.sql and execute the commands when done, enter:

EDIT START.SQL;

In the next example, a user wants to enter SELECT DISTINCT JOB_CODE, JOB_TITLE FROM JOB; interactively: Instead, the user mistakenly omits the DISTINCT keyword. Issuing the EDIT command opens the statement in an editor and then executes the edited statement when the editor exits.

SELECT JOB_CODE, JOB_TITLE FROM JOB;
EDIT;

See Also