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

« Previous Version 3 Next »

Prepare a statement to execute.

  • You will only need to prepare a statement if you have markers in the WHERE clause within the statement. You can use pjs.executeDirect() otherwise.
  • You must connect to the database first.
Parameters
  1. SQL statement string.

Return Value

This method will return a handler which much be used again in other statements.

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
pjs.connect("*LOCAL");
 
var _stm = pjs.prepare("SELECT * FROM PJSTEST/PRODUCTSP WHERE PRID like ?");
  • No labels