The SQL LOGOUT command closes the connection of the current process (if applicable). If there is no connection, the command does nothing.
If the logout is performed properly, the system variable OK is set to 1; otherwise, it is set to 0. You can intercept this error with an error-handling method installed by the ON ERR CALL command.