Procedure documentationEditing Commands in an External File Locate this document in the navigation structure

 

If you have entered a long command in SQLCLI, you can make changes to this command at a later stage by editing the command buffer in an external file.

Further information: Command Buffer

Prerequisites

You have already executed a command.

More information: Executing a Command

Procedure

  1. To export the contents of the command buffer to an external file, enter the following command:

    \e [<file>]

    • Enter the complete file path and <file> name.

    • If you do not specify a file, SQLCLI generates a temporary file.

    The system opens the file in an editor. To determine which editor will be used, SQLCLI evaluates the environment variables SQLCLI_EDITOR,EDITOR and VISUAL in succession. If you have not set any of these environment variables, Notepad is used on Microsoft Windows and vi on Linux and Unix. For information on setting environment variables, see your operating system documentation.

  2. Make the desired changes to the file.

  3. Save the file in the editor then close file and editor.

Result

You have changed the contents of the command buffer and can now execute the changed command with the command \g.