This API executes a non-prepared statement on IBM i, which can be used if there are no parameter markers in your SQL.
The API can also be called in the form of a method attached to a statement object as follows: stmt.executeDirect().
Note: There is a security risk if you do not sanitize any user input that is passed into this API. This is what prepared statements will do for you automatically.
- Non-prepared handle (from pjs.allocStmt()). This parameter can be omitted if the API is called as a statement method.
- SQL statement string
- The SQL statement must be valid for the database you are using
This method will return a handle which must be used again in other statements.
SQL diagnostics are reported in the SQLCA:
SQLCA fields are defined in Profound.js programs with the names in lowercase. sqlcode will be set to zero if execution was successful.
When using an IBM i database, this API requires the Profound.js Connector module.