Closes Client-Library and deallocates all Embedded SQL resources allocated to your program.
exec sql exit end-exec
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 HOST-VAR PIC X(100).
EXEC SQL END DECLARE SECTION END-EXEC.
...
EXEC SQL SELECT getdate() INTO :HOST-VAR END-EXEC.
DISPLAY "THE CURRENT DATE AND TIME IS: ", HOST-VAR.
* Note that the exit statement must be the last embedded SQL statement
* in the program.
EXEC SQL EXIT END-EXEC.
The exit statement closes all connections that your program opened. Also, exit deallocates all Embedded SQL resources and Client-Library resources allocated to your program.
Although the exit statement is valid on all platforms, it is required only on some. For more information, see the Open Client and Open Server Programmer’s Supplement.
You cannot use Client-Library functions after using the exit statement, unless you initialize Client-Library again. See the Open Client Client-Library/C Programmers Guide for information about initializing Client-Library.
The exit statement is a Sybase extension; it is not defined in the SQL standard.
disconnect