DB2 Version 9.7 for Linux, UNIX, and Windows

EDIT command

Launches a user-specified editor with a specified command for editing. When the user finishes editing, saves the contents of the editor and exits the editor, permits the user to execute the command in CLP interactive mode.

Scope

This command can only be run within CLP interactive mode. Specifically, it cannot be run from the CLP command mode or the CLP batch mode.

Authorization

None

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-+-EDIT-+--+----------------+--+-----+-----------------------><
   '-E----'  '-EDITOR--editor-'  '-num-'   

Command parameters

EDITOR
Launch the editor specified for editing. If this parameter is not specified, the editor to be used is determined in the following order:
  1. the editor specified by the DB2_CLP_EDITOR registry variable
  2. the editor specified by the VISUAL environment variable
  3. the editor specified by the EDITOR environment variable
  4. On Windows operating systems, the Notepad editor; on UNIX operating systems, the vi editor
num
If num is positive, launches the editor with the command corresponding to num. If num is negative, launches the editor with the command corresponding to num, counting backwards from the most recent command in the command history. Zero is not a valid value for num. If this parameter is not specified, launches the editor with the most recently run command. (This is equivalent to specifying a value of -1 for num.)

Usage notes

  1. The editor specified must be a valid editor contained in the PATH of the operating system.
  2. You can view a list of the most recently run commands available for editing by executing the HISTORY command.
  3. The EDIT command will never be recorded in the command history. However, if you choose to run a command that was edited using the EDIT command, this command will be recorded in the command history.