SQL/MX Remote Conversational Interface (RMXCI) Guide for SQL/MX Release 3.2 (H06.25+, J06.14+)
EXIT command
The exit command disconnects from the database and exits the RMXCI session. The exit
command 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. The 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 91). See
“Condition Parameter” (page 91).
Considerations
You must enter the command in one line.
Examples
• The following command disconnects and exits from RMXCI:
SQL>exit
• If the previously run command returns the error code 4082, the conditional exit command
stops the execution of the script file and then disconnects and exits from RMXCI.
SQL>log /usr/home/errorCode.log
SQL>select * from employee;
SQL>exit if errorcode=4082
SQL>log off
The following results are logged on getting error code 4082:
SQL>select * from employee;
*** ERROR[4082] Table, view or stored procedure SCH.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
The following example exits RMXCI if the last error code is 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 RMXCI
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 91).
86 RMXCI commands










