添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge
[Android.Runtime.Register("execSQL", "(Ljava/lang/String;[Ljava/lang/Object;)V", "GetExecSQL_Ljava_lang_String_arrayLjava_lang_Object_Handler")]
public virtual void ExecSQL (string? sql, Java.Lang.Object[]? bindArgs);
[<Android.Runtime.Register("execSQL", "(Ljava/lang/String;[Ljava/lang/Object;)V", "GetExecSQL_Ljava_lang_String_arrayLjava_lang_Object_Handler")>]
abstract member ExecSQL : string * Java.Lang.Object[] -> unit
override this.ExecSQL : string * Java.Lang.Object[] -> unit

Parameters

Remarks

Execute a single SQL statement that is NOT a SELECT/INSERT/UPDATE/DELETE.

For INSERT statements, use any of the following instead. <ul> <li> #insert(String, String, ContentValues) </li> <li> #insertOrThrow(String, String, ContentValues) </li> <li> #insertWithOnConflict(String, String, ContentValues, int) </li> </ul>

For UPDATE statements, use any of the following instead. <ul> <li> #update(String, ContentValues, String, String[]) </li> <li> #updateWithOnConflict(String, ContentValues, String, String[], int) </li> </ul>

For DELETE statements, use any of the following instead. <ul> <li> #delete(String, String, String[]) </li> </ul>

For example, the following are good candidates for using this method: <ul> <li>ALTER TABLE</li> <li>CREATE or DROP table / trigger / view / index / virtual table</li> <li>REINDEX</li> <li>RELEASE</li> <li>SAVEPOINT</li> <li>PRAGMA that returns no data</li> </ul>

When using #enableWriteAheadLogging() , journal_mode is automatically managed by this class. So, do not set journal_mode using "PRAGMA journal_mode'<value>" statement if your app is using #enableWriteAheadLogging()

Note that PRAGMA values which apply on a per-connection basis should <em>not</em> be configured using this method; you should instead use #execPerConnectionSQL to ensure that they are uniformly applied to all current and future connections.

Java documentation for android.database.sqlite.SQLiteDatabase.execSQL(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.

[Android.Runtime.Register("execSQL", "(Ljava/lang/String;)V", "GetExecSQL_Ljava_lang_String_Handler")]
public virtual void ExecSQL (string? sql);
[<Android.Runtime.Register("execSQL", "(Ljava/lang/String;)V", "GetExecSQL_Ljava_lang_String_Handler")>]
abstract member ExecSQL : string -> unit
override this.ExecSQL : string -> unit

Parameters

Remarks

Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.

It has no means to return any data (such as the number of affected rows). Instead, you're encouraged to use #insert(String, String, ContentValues) , #update(String, ContentValues, String, String[]) , et al, when possible.

When using #enableWriteAheadLogging() , journal_mode is automatically managed by this class. So, do not set journal_mode using "PRAGMA journal_mode'<value>" statement if your app is using #enableWriteAheadLogging()

Note that PRAGMA values which apply on a per-connection basis should <em>not</em> be configured using this method; you should instead use #execPerConnectionSQL to ensure that they are uniformly applied to all current and future connections.

Java documentation for android.database.sqlite.SQLiteDatabase.execSQL(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.