602SQL Documentation Index  

wb_close

PHP

boolean wb_close( resource connection )
boolean wb_close( resource odbc_connection )
boolean wb_close( resource cursor )
boolean wb_close( resource lob )
boolean wb_close( resource psql )


Parameters

connection
Connection identifier returned by the wb_connect function.
odbc_connection
Connection identifier returned by the wb_odbc_connect function.
cursor
Cursor identifier returned by the wb_exec function.
lob
LOB identifier returned by the wb_result or wb_fetch_into function in the WB_LOBMODE_RESOURCE LOB mode (see wb_set_lob_mode).
psql
Prepared SQL statement identifier returned by the wb_psql_prepare function.


Description

This function will close/open a connection, cursor, LOB (Large Object, value of the database column of the BLOB, CLOB or NCLOB type) or a prepared SQL statement. If the connection was opened using the wb_pconnect function, it will not be closed, but the function will still return TRUE. This corresponds with persistent connection logic.

Connections, cursors, LOBs and prepared SQL statements do not need to be closed before the PHP script is done, the PHP module will close them after the page is generated according to the PHP script. You can however free resources consumed by these objects by explicitly closing them, but these resources are relatively small. Closing cursors is only needed when a PHP script needs to open many cursors (ten or more). You must close all LOBs that were opened from a cursor before explicitly closing the cursor. You have to close all cursors and prepared SQL statements that were opened using a connection before explicitly closing the database connection.



Returns

TRUE if succesful, FALSE otherwise.



Example

$conn=wb_connect("wbserver", "_sysext", "Anonymous", "");
$res=wb_exec($conn, "select logname from Usertab where Ord(category)=CATEG_USER");
wb_result_all($res,"border=1");
wb_close($res);
wb_close($conn);	 

Viz