pjs.allocStmt()

 

This API allocates a statement handle.

Using a statement handle, you can set statement attributes, execute SQL statements, and fetch data.

Parameters

1. Database connection: A database connection definition object returned by pjs.getDB(). If not passed, the default database connection is used.

Return Value

The API returns a handle, which can be used again in other statements.

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.

Example