This API prepares a statement to execute.
- You will only need to prepare a statement if you have markers in the SQL WHERE clause within the statement. You may use pjs.executeDirect() otherwise.
- You must have a connection to a database before using this API.
Parameter
- SQL statement string
Return Value
This method will return a handle 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 statementHandle = pjs.prepare("SELECT * FROM PJSTEST/PRODUCTSP WHERE PRID like ?");
Requirements
This API requires the Profound.js Connector module.