SupportSQLiteStatement



An interface to map the behavior of android.database.sqlite.SQLiteStatement.

Summary

Public functions

Unit

Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.

android
Long

Execute this SQL statement and return the ID of the row inserted due to this call.

android
Int

Execute this SQL statement, if the the number of rows affected by execution of this SQL statement is of any importance to the caller - for example, UPDATE / DELETE SQL statements.

android
Long

Execute a statement that returns a 1 by 1 table with a numeric value.

android
String?

Execute a statement that returns a 1 by 1 table with a text value.

android

Inherited functions

From java.io.Closeable
Unit
android
From androidx.sqlite.db.SupportSQLiteProgram
Unit
bindBlob(index: Int, value: ByteArray)

Bind a byte array value to this statement.

android
Unit
bindDouble(index: Int, value: Double)

Bind a double value to this statement.

android
Unit
bindLong(index: Int, value: Long)

Bind a long value to this statement.

android
Unit
bindNull(index: Int)

Bind a NULL value to this statement.

android
Unit
bindString(index: Int, value: String)

Bind a String value to this statement.

android
Unit

Clears all existing bindings.

android

Public functions

execute

fun execute(): Unit

Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.

Throws
android.database.SQLException

If the SQL string is invalid for some reason

executeInsert

fun executeInsert(): Long

Execute this SQL statement and return the ID of the row inserted due to this call. The SQL statement should be an INSERT for this to be a useful call.

Returns
Long

the row ID of the last row inserted, if this insert is successful. -1 otherwise.

Throws
android.database.SQLException

If the SQL string is invalid for some reason

executeUpdateDelete

fun executeUpdateDelete(): Int

Execute this SQL statement, if the the number of rows affected by execution of this SQL statement is of any importance to the caller - for example, UPDATE / DELETE SQL statements.

Returns
Int

the number of rows affected by this SQL statement execution.

Throws
android.database.SQLException

If the SQL string is invalid for some reason

simpleQueryForLong

fun simpleQueryForLong(): Long

Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table;

Returns
Long

The result of the query.

Throws
android.database.sqlite.SQLiteDoneException

if the query returns zero rows

simpleQueryForString

fun simpleQueryForString(): String?

Execute a statement that returns a 1 by 1 table with a text value. For example, SELECT COUNT(*) FROM table;

Returns
String?

The result of the query.

Throws
android.database.sqlite.SQLiteDoneException

if the query returns zero rows