Condividi tramite


SQLiteDatabase.ExecPerConnectionSQL(String, Object[]) Method

Definition

Execute the given SQL statement on all connections to this database.

[Android.Runtime.Register("execPerConnectionSQL", "(Ljava/lang/String;[Ljava/lang/Object;)V", "GetExecPerConnectionSQL_Ljava_lang_String_arrayLjava_lang_Object_Handler", ApiSince=30)]
public virtual void ExecPerConnectionSQL (string sql, Java.Lang.Object[]? bindArgs);
[<Android.Runtime.Register("execPerConnectionSQL", "(Ljava/lang/String;[Ljava/lang/Object;)V", "GetExecPerConnectionSQL_Ljava_lang_String_arrayLjava_lang_Object_Handler", ApiSince=30)>]
abstract member ExecPerConnectionSQL : string * Java.Lang.Object[] -> unit
override this.ExecPerConnectionSQL : string * Java.Lang.Object[] -> unit

Parameters

sql
String

The SQL statement to be executed. Multiple statements separated by semicolons are not supported.

bindArgs
Object[]

The arguments that should be bound to the SQL statement.

Attributes

Remarks

Execute the given SQL statement on all connections to this database.

This statement will be immediately executed on all existing connections, and will be automatically executed on all future connections.

Some example usages are changes like PRAGMA trusted_schema=OFF or functions like SELECT icu_load_collation(). If you execute these statements using #execSQL then they will only apply to a single database connection; using this method will ensure that they are uniformly applied to all current and future connections.

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

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