Android.Database.Sqlite.SQLiteDatabase.ExecSQL Method
Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.

Syntax

[Android.Runtime.Register("execSQL", "(Ljava/lang/String;)V", "GetExecSQL_Ljava_lang_String_Handler")]
public virtual void ExecSQL (string sql)

Parameters

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

Exceptions

TypeReason
Android.Database.SQLExceptionif the SQL string is invalid

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 SQLiteDatabase.Insert(string, System.String, System.String), SQLiteDatabase.Update(string, Android.Content.ContentValues, Android.Content.ContentValues, Android.Content.ContentValues), et al, when possible.

When using SQLiteDatabase.EnableWriteAheadLogging, journal_mode is automatically managed by this class. So, do not set journal_mode using "PRAGMA journal_mode'" statement if your app is using SQLiteDatabase.EnableWriteAheadLogging

[Android Documentation]

Requirements

Namespace: Android.Database.Sqlite
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1