INF: Invoking an Editor from ISQL

ID Number: Q36929

1.00 1.11 4.20

OS/2

Summary:

The following is an explanation of how to envoke an editor from

within ISQL.

More Information:

Before running ISQL, the EDITOR environment parameter must be set to

the name of the editor's executable file and the executable file must

be available on the path. Be sure that environment parameters for the

editor (such as TMP or INIT) are also set. Once inside ISQL, use the

"ed" command to invoke the editor.

ISQL writes the contents of its input buffer to a temporary file and

spawns the specified editor to edit that temporary file. When the

editor terminates, ISQL reads the temporary file back into its input

buffer.

The default editor is EDLIN, which will not run in protected mode. If

the specified editor cannot be spawned, ISQL will produce the

following message

DB-Library: spawnlp failed in dbedit(xxx):n

where "xxx" is the name of the editor that ISQL is attempting to

spawn, and "n" is the C run-time library error code returned by

spawnlp(). Common error codes are as follows:

2 Not Found

8 Not 'EXE' format

12 Not enough memory

If TMP is not set, the MEP editor may produce a GP fault or messages

such as "Unable to open swap file." ISQL may produce its own message,

as follows

Unknown error from xxx:n

where "xxx" is the name of the editor that ISQL is attempting to

spawn, and "n" is the error code returned by the editor.

If you are having difficulty invoking an editor with the "ed" command,

try using the ISQL shell command "!!". This command will use the C

run-time function system() rather than spawnlp() and may help expose

the source of the problem.

Additional reference words: ISQL