Compartir a través de


IPreparedStatement.SetNull Method

Definition

Overloads

SetNull(Int32, Int32)

Sets the designated parameter to SQL NULL.

SetNull(Int32, Int32, String)

Sets the designated parameter to SQL NULL.

SetNull(Int32, Int32)

Sets the designated parameter to SQL NULL.

[Android.Runtime.Register("setNull", "(II)V", "GetSetNull_IIHandler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetNull (int parameterIndex, int sqlType);
[<Android.Runtime.Register("setNull", "(II)V", "GetSetNull_IIHandler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetNull : int * int -> unit

Parameters

parameterIndex
Int32

the first parameter is 1, the second is 2, ...

sqlType
Int32

the SQL type code defined in java.sql.Types

Attributes

Exceptions

if a database error happens.

Remarks

Sets the designated parameter to SQL NULL.

<B>Note:</B> You must specify the parameter's SQL type.

Java documentation for java.sql.PreparedStatement.setNull(int, 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

SetNull(Int32, Int32, String)

Sets the designated parameter to SQL NULL.

[Android.Runtime.Register("setNull", "(IILjava/lang/String;)V", "GetSetNull_IILjava_lang_String_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetNull (int parameterIndex, int sqlType, string? typeName);
[<Android.Runtime.Register("setNull", "(IILjava/lang/String;)V", "GetSetNull_IILjava_lang_String_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetNull : int * int * string -> unit

Parameters

parameterIndex
Int32

the first parameter is 1, the second is 2, ...

sqlType
Int32

a value from java.sql.Types

typeName
String

the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or REF

Attributes

Exceptions

if a database error happens.

Remarks

Sets the designated parameter to SQL NULL. This version of the method setNull should be used for user-defined types and REF type parameters. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

<B>Note:</B> To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined type the name is the type name of the parameter itself. For a REF parameter, the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it.

Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.

Added in 1.2.

Java documentation for java.sql.PreparedStatement.setNull(int, int, 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.

See also

Applies to