INF: Invoking an Editor from ISQL

Last reviewed: April 25, 1997
Article ID: Q36929

The information in this article applies to:

  - Microsoft SQL Server version 4.2 for 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 query words: ISQL
Keywords : kbtool SSrvISQL
Version : 4.20
Platform : OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.