Execute a prepared statement. This must be called after binding parameters.
Parameters
- Handle. Must be a handle from a prepare statement only.
Return Value
None.
Exception Handling
An Error instance will be thrown with the following properties:
- message - The IBM i message text.
- error - The message id.
- help - The message help text.
Examples
SearchTerm = '%' + search + '%'; Statement = 'SELECT * FROM PRODUCTSP '; Statement += 'WHERE '; Statement += 'UPPER(PRNAME) LIKE ? '; Statement += 'OR '; Statement += 'UPPER(PRDESC) LIKE ? '; Statement += 'OR '; Statement += 'UPPER(PRIMAGE) LIKE ? '; Statement += ' FOR FETCH ONLY'; c1 = pjs.prepare(Statement); pjs.setStmtAttr(c1, SQL_ATTR_CURSOR_SCROLLABLE, SQL_TRUE); pjs.bindParameters(c1, [ [SearchTerm, SQL_PARAM_INPUT], [SearchTerm, SQL_PARAM_INPUT], [SearchTerm, SQL_PARAM_INPUT] ]); pjs.execute(c1);