Neoview Command Interface (NCI) Guide (R2.4)
EXIT Command
The EXIT command disconnects from and exits NCI. EXIT can return a status code. If no status
code is specified, zero is returned by default. In addition, a conditional statement can be appended
to the command.
Syntax
EXIT [WITH][status][IF{condition}]
status
is any 1-byte integer. status is a shell return value, and the range of allowable values is
platform dependent.
condition
is the same as the condition parameter defined for the “IF...THEN Command” (page 102). See
“Condition Parameter” (page 102).
Considerations
• You must enter the command on one line. The command does not require an SQL terminator.
Examples
• This command disconnects from and exits the NCI, which disappears from the screen:
SQL>exit
• In a script file, the conditional exit command causes the script file to quit running and
disconnect from and exit the NCI when the previously run command returns error code
4082:
log c:\errorCode.log
select * from employee;
exit if errorcode=4082
log off
These results are logged when error code 4082 occurs:
SQL>select * from employee;
*** ERROR[4082] Table, view or stored procedure NEO.USR.EMPLOYEE
does not exist or is inaccessible.
SQL>exit if errorcode=4082
• The following two examples are equivalent:
SQL> EXIT -1 IF LASTERROR <> 0
SQL> EXIT WITH -1 IF LASTERROR != 0
This example exits NCI if the last error code is equal to 4082:
SQL> EXIT WITH 82 IF LASTERROR == 4082
SQL> EXIT -- default status is 0
FC Command
The FC command allows you to edit and reissue a command in the history buffer of an NCI
session. You can display the commands in the history buffer by using the HISTORY command.
For information about the history buffer, see the “HISTORY Command” (page 101).
96 NCI Commands