xcall SQL, SQLOP_DISCONNECT, cmdhdr
This operation terminates a connection to the database.
Parameters
cmdhdr (ST_SQL_CMDHDR), [in/out]
The fields of interest to this opcode in the cmdhdr structure (defined in SQL.DEF) are listed below.
Field |
Dir |
Notes |
---|---|---|
handle |
in |
handle to connection (returned from SQLOP_INIT_CONN) |
dbmsconid |
in |
|
opflags |
n/a |
|
cmdarg1,2 |
n/a |
|
rc |
out |
return code (0 = ok, see SQLERR_xxx) |
rcext |
out |
extended error code |
info1,2 |
n/a |
|
sqlstate |
out |
ANSI standard SQL state code |
reshdl |
n/a |
|
psthdl |
n/a |
|
Notes
All result sets and prepared statements associated with the connection will be freed upon disconnect (if not already done explicitly). After disconnecting, if finished with the database engine, call SQLOP_CLOSE_LIB.
SQLOP_DISCONNECT will be called automatically at the end of a RUN program, or an SBX with the AF_SBXASRUN ASFLAG flag set, for any SQL connections that are still connected. This is analogous to the automatic close of other file types at the end of a program. SQLOP_CLOSE_LIB will effectively be called at the end of an A-Shell session.