Please enable JavaScript to view this site.

ASQL Reference

xcall SQL, SQLOP_CLOSE_LIB, cmdhdr

The SQLOP_CLOSE_LIB function closes the SQL library and releases the resources allocated by the SQLOP_INIT_LIB call and accumulated by other calls in the interim.

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

connection handled returned from SQLOP_INIT_CONN

dbmsconid

in

DBMS Connector ID

opflags

n/a

 

cmdarg1,2

n/a

 

rc

out

return code (0 = ok, see SQLERR_xxx)

rcext

out

extended return code (dbms err if rc = SQLERR_DBMSERR)

info1,2

n/a

 

sqlstate

n/a

 

reshdl

n/a

 

psthdl

n/a

 

 

History

2012 January, 1.4(130): SQLOP_INIT_LIB and SQLOP_CLOSE_LIB can now be nested, allowing modules (such as SBXs) to init and later close the SQL library without having to be aware of whether the library was already opened by the calling routine. A counter is used to keep track of the nesting level, and the status code (rc = SQLERR_NESTIGNORED) is returned just to indicate that the nested SQLOP_CLOSE_LIB request didn't actually close the library. Typically an application would ignore that status unless it really wanted to globally close the library.