Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

This API closes a defined handle.

You should close every handle in your module after you've finished using it. However, if a handle is not closed, Profound.js will automatically attempt to close all open handles when an error occurs or when the Profound.js module exits.

The API can also be called in the form of a method attached to a statement handle object as follows: stmt.close().

Parameter
  1. Handle created from pjs.prepare() or pjs.executeDirect(). This parameter can be omitted if the API is called as a statement method.

Exception Handling

SQL diagnostics are reported in the SQLCA:

https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/db2/rbafzfielddescsqlca.htm

SQLCA fields are defined in Profound.js programs with the names in lowercase. sqlcode will be set to zero if execution was successful.

Examples
Called directly
var handle = pjs.allocStmt();
pjs.executeDirect(handle, "SELECT * FROM PJSTEST/PRODUCTSP");
 
//...
 
pjs.close(handle);
Called as a method
var handle = pjs.allocStmt();
handle.executeDirect("SELECT * FROM PJSTEST/PRODUCTSP");
 
//...
 
handle.close();

Requirements

When using an IBM i database, this API requires the Profound.js Connector module.

  • No labels