PreparedStatement
Description
- Derived from
-
Disposable abstract
INativeHandle
| Full source code is included in the Tinman 3D SDK download. |
The PreparedStatement is a wrapper for a native sqlite3_stmt* pointer to a prepared statement.
Executing a prepared statement takes the following steps:
-
Obtain a PreparedStatement object, either by calling DatabaseFile.Prepare to create a new one or StatementCollection.Reset to get a cached one in fresh state.
-
Use the
Parameter*methods to fill in the parameter values. -
Use the
Step*methods to move through the result rows. For each result row, use theColumn*methods to fetch column data. -
Call Reset when done, to avoid SQLite3.LOCKED errors.
-
Use RowChanges and RowIdentifier to fetch information about the most recently executed statement.
Public / Methods
ColumnBytes
Returns a result row column as a byte sequence.
The contents of the returned ByteBuffer is valid until ColumnBytes, Step or Reset is called.
- See also
Parameter
6 overloads
Binds NULL to the given parameter.
- IOException
-
If an I/O error has occurred.
- See also
Binds the given value in to a parameter.
- IOException
-
If an I/O error has occurred.
- See also
Binds the given value in to a parameter.
- IOException
-
If an I/O error has occurred.
- See also
Binds the given value in to a parameter.
If value in is not a number (see Maths.IsNumber), this method delegates to Parameter1.
- IOException
-
If an I/O error has occurred.
- See also
Binds the given value in to a parameter.
If value in is null, this method delegates to Parameter1.
- IOException
-
If an I/O error has occurred.
- See also
Binds the given value in to a parameter.
If value in is null, this method delegates to Parameter1. The parameter binding is set to ByteBuffer.RawPosition and ByteBuffer.Remaining of value in, assuming that the ByteBuffer object is not modified until the statement finishes.
- IOException
-
If an I/O error has occurred.
- See also
Reset
Resets the prepared statement for being executed again later.
A prepared statement should be reset after each execution, to avoid SQLite3.LOCKED errors. The Step method automatically resets the prepared statement.
- IOException
-
If an I/O error has occurred.
- See also
Step
Steps through the result rows of the statement, evaluating it upon the first call.
Reset must be called on this statement only if this method has returned a value greater than zero. In all other cases, the statement is reset automatically before the method returns or throws.
- IOException
-
If an I/O error has occurred.
- See also
StepDone
Steps through the result rows of the statement, expecting SQLite3.DONE.
This method delegates to Step passing 2.
- IOException
-
If an I/O error has occurred.
- See also
StepRow
Steps through the result rows of the statement, expecting SQLite3.ROW or SQLite3.DONE.
This method delegates to Step passing 3 and returns true if a value greater than zero is returned.
- IOException
-
If an I/O error has occurred.
- See also