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 Version History

« Previous Version 6 Next »

This API executes a prepared statement. It should be be called after parameter binding.

Parameters
  1. Handle from a prepared statement

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.
Example
  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);


Requirements

This API requires the Profound.js Connector module.

  • No labels