pjs.setStmtAttr()
This API sets an attribute of a statement handle.
The API can also be called in the form of a method attached to a statement object as follows: stmt.setAttr().
Parameters
The handle which is created from pjs.prepare() or pjs.allocStmt(). This parameter is omitted if the API is called as a statement method.
Attribute to change
New attribute value
Attributes and their valid values
profound.SQL_ATTR_CURSOR_SENSITIVITY
profound.SQL_INSENSITIVE
profound.SQL_SENSITIVE
preciseDecimal
Set to string or boolean value before executing query to override global preciseDecimal setting for statement result sets.
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 c1 = pjs.allocStmt();
pjs.setStmtAttr(c1, SQL_ATTR_CURSOR_SCROLLABLE, SQL_TRUE);
// ...
Called as a method
var c1 = pjs.prepare("SELECT * FROM productsp WHERE prid = ?");
c1.setAttr(SQL_ATTR_CURSOR_SCROLLABLE, SQL_TRUE);
// ...
Requirements
This API requires the Profound.js Connector module.
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!