Available Shells
In the ObjectScript shell, you can start and use other shells that enable you to query data or run code in various ways. You can also start and use operating-system shells.
Python Shell
To start the Python shell, enter :py or the following equivalent command:
do ##class(%SYS.Python).Shell()
The prompt then becomes >>>
Then you can enter Python commands and see their results.
To exit this shell, enter the command quit() (not case-sensitive).
For more information, see From the Python Shell.
SQL Shell
To start the SQL shell, enter :sql or the following equivalent command:
Do $SYSTEM.SQL.Shell()
The prompt then changes to indicate that you are running within the SQL Shell. Specifically the [SQL] prefix is added and a trailing > is added. For example:
[SQL]USER>>
Then you can enter SQL queries and see their results.
The Ctrl+c command (normally used for interruption) is disabled within the SQL shell.
To exit this shell, enter q or quit (not case-sensitive).
For more information, including details on multi-line mode and specifying an SQL dialect, see Using the SQL Shell Interface.
TSQL Shell
To start the TSQL Shell, enter :tsql or the following equivalent command:
Do $system.SQL.TSQLShell()
The prompt then changes to indicate that you are running within the TSQL Shell. Specifically a trailing > is added.
Then you can enter Transact-SQL queries and see their results. You can use either the MSSQL or the Sybase dialect.
To exit this shell, enter q or quit (not case-sensitive).
For more information, see Working with TSQL Using SQL.
MDX Shell
To start the MDX shell, enter :mdx or the following equivalent command:
Do ##class(%DeepSee.Utils).%Shell()
The prompt then becomes >>
Then you can enter MDX queries and see their results.
To exit this shell, enter q or quit (not case-sensitive).
For more information, see MDX Shell.
Operating-System Shells
In the ObjectScript shell, you can also open your default operating-system shell. To do so, type ! or $ and press Enter. The prompt then shows the working directory. For example:
USER>!
c:\intersystems\iris\mgr\user\>
On Macintosh, you cannot open the C-shell this way; you receive a permission denied error. You can, however, use other shells (Bash, Bourne, or Korn).
To exit the shell, use the quit or exit command as appropriate for the shell.