This table describes how to address common errors you can encounter when working with SQL
prepared statements. For details about SQL prepared statements, see the SQLPreparedStatement
object.
Error Message | Probable Causes | Resolution |
---|---|---|
Invalid SQL statement. SQL prepared statement must be SELECT, INSERT,
UPDATE, DELETE, or CALL. | The SQL prepared statement is invalid. | Specify a valid SQL prepared statement in the
|
Invalid SQL statement. SQL prepared statement must have at least one
SQL parameter. | The specified SQL prepared statement is invalid because it has no parameters. | Specify at least one parameter value to bind in the SQL prepared statement
by using the |
Parameter selection out of range. Vector must contain integers between
1 and n, where n is the number of parameters. | The specified indices for the selected parameters in the | Specify indices for the selected parameters within the range of the
parameter values in the |
Parameter index must be a numeric scalar. | The specified indices for the selected parameters in the | Specify numeric index values for the selected parameters in the
|
Value must be a cell array with length between 1 and n, where n is the
number of parameters. | The parameter values in the | The values to bind must be a cell array that has a length between 1 and
|
bindParamValues
| close
| databasePreparedStatement