pjs.setConnectAttr()
Â
This API sets an attribute of an SQL connection.
Parameters
This API can accept an optional database connection definition object to select between multiple database connections. To select the database connection, call pjs.getDB() and pass the result as the first parameter, followed by the parameters documented below. If a database connection definition object is not passed, the default database connection is used.
Attribute to change.
New attribute value
Attributes and their valid values
See the IBM i SQL CLI documentation for a list of attributes and their values.
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
//Use SQL naming convention
pjs.setConnectAttr(SQL_ATTR_DBC_SYS_NAMING, SQL_FALSE);
Â
var c1 = pjs.allocStmt();
pjs.executeDirect(c1, "select prid from demolib.productsp order by prid");
pjs.fetchLast(c1, prid);
pjs.close(c1);
Â
pjs.disconnect();
Â
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!