Język

DatabaseUtils.LongForQuery Method

Definition

Overloads

Name Description
LongForQuery(SQLiteDatabase, String, String[])

Utility method to run the query on the db and return the value in the first column of the first row.

LongForQuery(SQLiteStatement, String[])

Utility method to run the pre-compiled query and return the value in the first column of the first row.

LongForQuery(SQLiteDatabase, String, String[])

Utility method to run the query on the db and return the value in the first column of the first row.

[Android.Runtime.Register("longForQuery", "(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;[Ljava/lang/String;)J", "")]
public static long LongForQuery(Android.Database.Sqlite.SQLiteDatabase? db, string? query, string[]? selectionArgs);
[<Android.Runtime.Register("longForQuery", "(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;[Ljava/lang/String;)J", "")>]
static member LongForQuery : Android.Database.Sqlite.SQLiteDatabase * string * string[] -> int64

Parameters

db
SQLiteDatabase

The database on which to execute the query. The database is not closed by this method.

query
String

The SQL query whose first row and first column supply the result.

selectionArgs
String[]

Values to bind as strings in parameter order, or null if no values are supplied. Array elements must not be null.

Returns

The first column of the first row as a 64-bit integer. A query with no rows throws SQLiteDoneException. The temporary query statement is closed before this method returns.

Attributes

Remarks

Utility method to run the query on the db and return the value in the first column of the first row.

Java documentation for android.database.DatabaseUtils.longForQuery(android.database.sqlite.SQLiteDatabase, java.lang.String, java.lang.String[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

LongForQuery(SQLiteStatement, String[])

Utility method to run the pre-compiled query and return the value in the first column of the first row.

[Android.Runtime.Register("longForQuery", "(Landroid/database/sqlite/SQLiteStatement;[Ljava/lang/String;)J", "")]
public static long LongForQuery(Android.Database.Sqlite.SQLiteStatement? prog, string[]? selectionArgs);
[<Android.Runtime.Register("longForQuery", "(Landroid/database/sqlite/SQLiteStatement;[Ljava/lang/String;)J", "")>]
static member LongForQuery : Android.Database.Sqlite.SQLiteStatement * string[] -> int64

Parameters

prog
SQLiteStatement

The compiled query to execute. The caller retains responsibility for closing the statement.

selectionArgs
String[]

Values to bind as strings in parameter order, or null to leave existing bindings unchanged. Array elements must not be null.

Returns

The first column of the first row as a 64-bit integer. A query with no rows throws SQLiteDoneException.

Attributes

Remarks

Utility method to run the pre-compiled query and return the value in the first column of the first row.

Java documentation for android.database.DatabaseUtils.longForQuery(android.database.sqlite.SQLiteStatement, java.lang.String[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to