ISQL Statements
3.7.13HOST or SH or !
Syntax
{ HOST SH ! } [host_command];
Description
The HOST statement executes a host operating system command without terminating the cur- rent ISQL session.
Arguments
HOST SH !
Synonyms for directing ISQL to execute an operating system command.
host_command
The operating system command to execute. If host_command is not specified, ISQL spawns a subshell from which you can issue multiple operating system commands. Use the exit com- mand to return to the ISQL> prompt.
Example
Consider a file in the local directory named query.sql. It contains a complex query that joins several tables in a sample database. From within ISQL You can display the contents of the file with the ISQL ! (shell) statement:
ISQL>
ISQL> host more
Usage: more
ISQL> | Use 'more' to display the query.sql script file: | |
ISQL> ! more query.sql |
| |
SELECT customers.customer_name, |
| |
| orders.order_info, |
|
| orders.order_state, |
|
| lot_staging.lot_location, |
|
FROM | lot_staging.start_date |
|
customers, |
| |
| orders, |
|
| lots, |
|
| lot_staging |
|
WHERE( customers.customer_id = orders.customer_id ) and | ||
| ( lots.lot_id = lot_staging.lot_id ) and | |
| ( orders.order_id = lots.order_id ) and | |
| ( ( customers.customer_name = 'Ship Shapers Inc.' ) AND | |
| ( lot_staging.start_date is not NULL ) AND | |
ISQL> | ( lot_staging.end_date is NULL ) ) | ; |
Spawn a subshell process to issue multiple OS commands: | ||
ISQL> sh |
|
|
.
.
.
FairCom Corporation |