Share via


IStatement.ExecuteUpdate Method

Definition

Overloads

ExecuteUpdate(String)

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

ExecuteUpdate(String, Int32)

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.

ExecuteUpdate(String, Int32[])

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

ExecuteUpdate(String, String[])

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

ExecuteUpdate(String)

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

[Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;)I", "GetExecuteUpdate_Ljava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int ExecuteUpdate (string? sql);
[<Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;)I", "GetExecuteUpdate_Ljava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ExecuteUpdate : string -> int

Parameters

sql
String

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Attributes

Exceptions

if an error occurs accessing the database or if the statement produces a ResultSet.

Remarks

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Java documentation for java.sql.Statement.executeUpdate(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

ExecuteUpdate(String, Int32)

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.

[Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;I)I", "GetExecuteUpdate_Ljava_lang_String_IHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int ExecuteUpdate (string? sql, int autoGeneratedKeys);
[<Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;I)I", "GetExecuteUpdate_Ljava_lang_String_IHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ExecuteUpdate : string * int -> int

Parameters

sql
String

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

autoGeneratedKeys
Int32

a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYSStatement.NO_GENERATED_KEYS

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Attributes

Exceptions

if an error occurs accessing the database or if the statement produces a ResultSet.

Remarks

Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.executeUpdate(java.lang.String, int).

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

ExecuteUpdate(String, Int32[])

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

[Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;[I)I", "GetExecuteUpdate_Ljava_lang_String_arrayIHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int ExecuteUpdate (string? sql, int[]? columnIndexes);
[<Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;[I)I", "GetExecuteUpdate_Ljava_lang_String_arrayIHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ExecuteUpdate : string * int[] -> int

Parameters

sql
String

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

columnIndexes
Int32[]

an array of column indexes indicating the columns that should be returned from the inserted row

Returns

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Attributes

Exceptions

if an error occurs accessing the database or if the statement produces a ResultSet.

Remarks

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.executeUpdate(java.lang.String, int[]).

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

ExecuteUpdate(String, String[])

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

[Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;[Ljava/lang/String;)I", "GetExecuteUpdate_Ljava_lang_String_arrayLjava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int ExecuteUpdate (string? sql, string[]? columnNames);
[<Android.Runtime.Register("executeUpdate", "(Ljava/lang/String;[Ljava/lang/String;)I", "GetExecuteUpdate_Ljava_lang_String_arrayLjava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ExecuteUpdate : string * string[] -> int

Parameters

sql
String

an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

columnNames
String[]

an array of the names of the columns that should be returned from the inserted row

Returns

either the row count for INSERT, UPDATE, or DELETE statements, or 0 for SQL statements that return nothing

Attributes

Exceptions

if an error occurs accessing the database or if the statement produces a ResultSet.

Remarks

Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the names of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.executeUpdate(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