PreparedStatement

Description

sealed class Tinman.AddOns.SQLite.PreparedStatement

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.

Public / Methods

Column​Bytes


[OwnerReturn]
public method ColumnBytes → (1)

index in : int32

The zero-based column index.

returns → ByteBuffer

The value.

Returns a result row column as a byte sequence.

Column​Float64


[Pure]
public method ColumnFloat64 → (1)

index in : int32

The zero-based column index.

returns → float64

The value.

Returns a result row column as a 64-bit floating-point value.

Column​Index


[Pure]
public method ColumnIndex → (1)

name in : string

The column name.

returns → int32

The zero-based column index or -1 if not found.

Returns the index of the given column.

Column​Int32


[Pure]
public method ColumnInt32 → (1)

index in : int32

The zero-based column index.

returns → int32

The value.

Returns a result row column as a 32-bit integer value.

Column​Int64


[Pure]
public method ColumnInt64 → (1)

index in : int32

The zero-based column index.

returns → int64

The value.

Returns a result row column as a 64-bit integer value.

Column​Name


[Pure]
public method ColumnName → (1)

index in : int32

The zero-based column index.

returns → string

The column name or null if not found.

Returns the name of the index in-th result row column.

Column​String


[Pure]
public method ColumnString → (1)

index in : int32

The zero-based column index.

returns → string

The value.

Returns a result row column as string value.

Parameter

6 overloads


public method Parameter1 → (1)

index in : int32

The one-based parameter index.

returns → PreparedStatement

this

Binds NULL to the given parameter.

IOException

If an I/O error has occurred.


public method Parameter2 → (2)

index in : int32

The one-based parameter index.

value in : int32

The parameter value.

returns → PreparedStatement

this

Binds the given value in to a parameter.

IOException

If an I/O error has occurred.


public method Parameter3 → (2)

index in : int32

The one-based parameter index.

value in : int64

The parameter value.

returns → PreparedStatement

this

Binds the given value in to a parameter.

IOException

If an I/O error has occurred.


public method Parameter4 → (2)

index in : int32

The one-based parameter index.

value in : float64

The parameter value.

returns → PreparedStatement

this

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.


public method Parameter5 → (2)

index in : int32

The one-based parameter index.

value in : string

The parameter value.

returns → PreparedStatement

this

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.


public method Parameter6 → (2)

index in : int32

The one-based parameter index.

value in : ByteBuffer

The parameter value.

returns → PreparedStatement

this

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.

Parameter​Clear


public method ParameterClear → ()

returns → PreparedStatement

this

Clears all parameter bindings.

IOException

If an I/O error has occurred.

Parameter​Index


[Pure]
public method ParameterIndex → (1)

name in : string

The statement parameter name.

returns → int32

The parameter index or 0 if not found.

Returns the index of a statement parameter.

Parameter​Name


[Pure]
public method ParameterName → (1)

index in : int32

The statement parameter index.

returns → string

The parameter name or null if not found.

Returns the name of a statement parameter.

Reset


public method Reset → (1)

throwOnError opt : bool = true

Throw an IOException if SQLite3.Reset returns a value other than SQLite3.OK?

returns → PreparedStatement

this

Resets the prepared statement for subsequent re-evaluation.

IOException

If an I/O error has occurred.

See also

SQLite3.Reset

Row​Changes


public method RowChanges → ()

returns → int64

The number of affected rows.

Returns the number of affected rows.

Row​Identifier


[Pure]
public method RowIdentifier → ()

returns → int64

The row identifier.

Returns the identifier of the inserted row.

Step


public method Step → (1)

success opt : int32 = 7

Bitflag to decide which result codes mean success:
1 : treat SQLite3.ROW as success,
2 : treat SQLite3.DONE as success,
4 : treat SQLite3.CONSTRAINT as success.

returns → int32

> 0 if a result row is available (see SQLite3.ROW),
= 0 if there are no more result rows (see SQLite3.DONE),
< 0 if a constraint has been violated (see SQLite3.CONSTRAINT).

Steps through the result rows of the statement, evaluating it upon the first call.

IOException

If an I/O error has occurred.

See also

SQLite3.Step

Step​Done


public method StepDone → ()

Steps through the result rows of the statement, expecting SQLite3.DONE.

IOException

If an I/O error has occurred.

See also

SQLite3.Step

Step​Row


public method StepRow → ()

returns → bool

true if a result row is available,
false if there are no more result rows

Steps through the result rows of the statement, expecting SQLite3.ROW or SQLite3.DONE.

IOException

If an I/O error has occurred.

See also

SQLite3.Step

Public / Attributes

Column​Count


public attribute ColumnCount → (get)

value : int32

[>=0]
The column count.

Returns the number of result row columns.

Parameter​Count


public attribute ParameterCount → (get)

value : int32

[>=0]
The parameter count.

Returns the number of parameters.