SQLEnd
- Last UpdatedJul 18, 2023
- 1 minute read
The function can be called with:
-
The connection handle, in which case the function releases resources allocated for the default recordset for this connection. Generally, SCADA does the operation automatically each time when a new query is executed through SQLExec on the connection, but the operation can be also triggered manually. However, using the SQLEnd function aids efficiency and creates good programming standards. SQLEnd releases the memory that was allocated when the last query was executed via SQLExec.
-
The recordset handle, in which case the function then removes the disconnected recordset associated with the handle from the system. This operation has to be done each time when the recordset is no longer necessary. Not removing recordsets from the system can result in consuming all available memory and halting SCADA and other applications on a computer.
This function is a blocking function and should not be called from a foreground task.
Syntax
SQLEnd(hGeneral)
hGeneral:
The handle either to:
The DB connection object, returned from either SQLCreate or SQLConnect function. The handle identifies the DB connection object where details of the associated SQL connection are stored.
Or:
The recordset.
Return Value
0 (zero) if successful, otherwise an error code is returned. (For details on the 307 error code, call the SQLErrMsg() function).
Related Functions
SQLCreate, SQLOpen, SQLClose, SQLDispose, SQLConnect, SQLDisconnect, SQLInfo, SQLSet, SQLAppend, SQLExec, SQLGetRecordset, SQLCall, SQLGetScalar, SQLEnd
Example
See SQLConnect.