Skip Headers
Oracle® Data Provider for .NET Developer's Guide
11g Release 2 (11.2.0.2)

Part Number E18754-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

OracleUdt Class

The OracleUdt class defines static methods that are used when converting between Custom Types and Oracle UDTs and vice-versa.

Class Inheritance

System.Object

  System.OracleUdt

Declaration

public sealed class OracleUdt

Thread Safety

All public static methods are thread-safe, although instance methods do not guarantee thread safety.

Requirements

Namespace: Oracle.DataAccess.Types

Assembly: Oracle.DataAccess.dll

ODP.NET Version: ODP.NET for .NET Framework 2.0 or ODP.NET for .NET Framework 4


OracleUdt Members

OracleUdt static methods are listed in Table 16-28.

Table 16-28 OracleUdt Static Methods

Static Method Description

Equals

Inherited from System.Object

GetValue

Gets the attributes or elements from the specified Oracle UDT (Overloaded)

IsDBNull

Indicates whether or not the specified attribute being retrieved is NULL (Overloaded)

SetValue

Sets the attributes or elements on the specified Oracle UDT (Overloaded)



OracleUDT Static Methods

OracleUDT methods are listed in Table 16-29.

Table 16-29 OracleUdt Static Methods

Static Method Description

Equals

Inherited from System.Object

GetValue

Gets the attributes or elements from the specified Oracle UDT (Overloaded)

IsDBNull

Indicates whether or not the specified attribute being retrieved is NULL (Overloaded)

SetValue

Sets the attributes or elements on the specified Oracle UDT (Overloaded)


GetValue

GetValue methods get the attributes or elements from the specified Oracle UDT.

Overload List:

GetValue(OracleConnection, IntPtr, string)

This method gets the attributes or elements from the specified Oracle UDT, using the specified attribute name.

Declaration

public static object GetValue(OracleConnection con, IntPtr pUdt, string attrName);

Parameters

Return Value

An object representing the returned attribute or collection elements.

Exceptions

ArgumentException - The specified name is not a valid attribute name.

Remarks

The IOracleCustomType.ToCustomObject method invokes OracleUdt.GetValue method passing it the con and pUdt parameters. The OracleUdt.GetValue method returns these types of object:

In the case of NULL attribute values, the appropriate null representation of the type is returned. For example, for attributes that are represented as Custom Types and Provider Specific Types, the static Null property of the type is returned. For attributes that are represented as Nullable types, for example, System.String and System.Array Types, null is returned, and for all other remaining built-in types such as Int32 and DateTime DBNull.Value is returned.

GetValue(OracleConnection, IntPtr, int)

This method gets the attribute or elements from the specified Oracle UDT, using the specified index.

Declaration

// C#
public static object GetValue(OracleConnection con, IntPtr pUdt, int attrIndex,);

Parameters

Return Value

An object representing the returned attribute or collection elements.

Exceptions

ArgumentOutOfRangeException - The specified index is not a valid attribute index.

Remarks

The IOracleCustomType.ToCustomObject method invokes OracleUdt.GetValue method passing it the con and pUdt parameters. The OracleUdt.GetValue method returns these types of object:

In the case of NULL attribute values, the appropriate null representation of the type is returned. For example, for attributes that are represented as Custom Types and Provider Specific Types, the static Null property of the type is returned. For attributes that are represented as Nullable types, for example, System.String and System.Array Types, null is returned, and for all other remaining built-in types such as Int32 and DateTime DBNull.Value is returned.

GetValue(OracleConnection, IntPtr, string, out object)

This method returns either the elements of the specified collection attribute of the specified Oracle Object or the elements of the specified Oracle Collection.

Declaration

// C#
public static object GetValue(OracleConnection con, IntPtr pUdt, string attrName,
  out object statusArray);

Parameters

Return Value

An object representing the returned attribute or collection elements.

Exceptions

ArgumentException - The specified name is not a valid attribute name.

Remarks

The IOracleCustomType.ToCustomObject method invokes OracleUdt.GetValue method passing it the con and pUdt parameters. The OracleUdt.GetValue method returns these types of object:

In the case of NULL attribute values, the appropriate null representation of the type is returned. For example, for attributes that are represented as Custom Types and Provider Specific Types, the static Null property of the type is returned. For attributes that are represented as Nullable types, for example, System.String and System.Array Types, null is returned, and for all other remaining built-in types such as Int32 and DateTime DBNull.Value is returned.

If the collection being returned is not NULL, the output statusArray parameter is populated with the null status for each of the collection elements.

GetValue(OracleConnection, IntPtr, int, out object)

This method returns either the elements of the specified collection attribute of the specified Oracle Object or the elements of the specified Oracle Collection.

Declaration

// C#
public static object GetValue(OracleConnection con, IntPtr pUdt, int attrIndex, 
   out object statusArray);

Parameters

Return Value

An object representing the returned attribute or collection elements.

Exceptions

ArgumentOutOfRangeException - The specified index is not a valid attribute index.

Remarks

The IOracleCustomType.ToCustomObject method invokes OracleUdt.GetValue method passing it the con and pUdt parameters. The OracleUdt.GetValue method returns these types of object:

In the case of NULL attribute values, the appropriate null representation of the type is returned. For example, for attributes that are represented as Custom Types and Provider Specific Types, the static Null property of the type is returned. For attributes that are represented as Nullable types, for example, System.String and System.Array Types, null is returned, and for all other remaining built-in types such as Int32 and DateTime DBNull.Value is returned.

If the collection being returned is not NULL, the output statusArray parameter is populated with the null status for each of the collection elements.

IsDBNull

IsDBNull methods indicate whether or not the specified attribute being retrieved is NULL.

Overload List:

IsDBNull(OracleConnection, IntPtr, string)

This method indicates whether or not the attribute being retrieved, specified by OracleConnection, pointer, and attribute name, is NULL.

Declaration

// C#
public static bool IsDBNull(OracleConnection con, IntPtr pUdt, string attrName);
 

Parameters

Return Value

True if the specified attribute is NULL; otherwise, false.

Exceptions

ArgumentException - The specified name is not a valid attribute name.

Remarks

This method is invoked from the IOracleCustomType.ToCustomObject method. The con and pUdt parameter is passed from the IOracleCustomType.ToCustomObject method to the OracleUdt.IsDBNull method. The attrName parameter is case-sensitive.

IsDBNull(OracleConnection, IntPtr, int)

This method indicates whether or not the attribute being retrieved, specified by OracleConnection, pointer, and attribute index, is NULL.

Declaration

// C#
public static bool IsDBNull(OracleConnection con, IntPtr pUdt, int attrIndex);
 

Parameters

Return Value

True if the specified attribute is NULL; otherwise, false.

Exceptions

ArgumentOutOfRangeException - The specified index is not a valid attribute index

Remarks

This method is invoked from the IOracleCustomType.ToCustomObject method. The con and pUdt parameter is passed from the IOracleCustomType.ToCustomObject method to the OracleUdt.IsDBNull method.

SetValue

SetValue methods set the attributes or elements on the specified Oracle UDT.

Overload List:

SetValue(OracleConnection, IntPtr, string, object)

This method sets the attribute or elements on the specified Oracle UDT, using the specified attribute name and value.

Declaration

// C#
public static void SetValue(OracleConnection con, IntPtr pUdt, string attrName, 
   object value);

Parameters

Exceptions

ArgumentException - The specified value is not of the appropriate type.

Remarks

The IOracleCustomType.FromCustomObject method invokes OracleUdt.SetValue method passing it the con and pUdt parameters. The OracleUdt.SetValue method returns these types of object:

SetValue(OracleConnection, IntPtr, int, object)

This method sets the attribute or elements on the specified Oracle UDT, using the specified index and value.

Declaration

// C#
public static void SetValue(OracleConnection con, IntPtr pUdt, int attrIndex, object value);

Parameters

Exceptions

ArgumentException - The specified value is not of the appropriate type.

Remarks

The IOracleCustomType.FromCustomObject method invokes OracleUdt.SetValue method passing it the con and pUdt parameters. The OracleUdt.SetValue method returns these types of object:

SetValue(OracleConnection, IntPtr, string, object, object)

This method sets either the specified collection attribute of the specified Oracle Object or elements of the specified Oracle Collection, to the specified value using the supplied null status of the collection elements.

Declaration

// C#
public static void SetValue(OracleConnection con, IntPtr pUdt, string attrName, 
   object value, object statusArray);

Parameters

Exceptions

ArgumentException - The specified value is not of the appropriate type.

Remarks

The IOracleCustomType.FromCustomObject method invokes OracleUdt.SetValue method passing it the con and pUdt parameters. The OracleUdt.SetValue method returns these types of object:

SetValue(OracleConnection, IntPtr, int, object, object)

This method sets either the specified collection attribute of the specified Oracle Object or elements of the specified Oracle Collection, to the specified value using the supplied null status of the collection elements.

Declaration

// C#
public static void SetValue(OracleConnection con, IntPtr pUdt, int attrIndex,
  object value, object statusArray);

Parameters

Exceptions

ArgumentException - The specified value is not of the appropriate type.

Remarks

The IOracleCustomType.FromCustomObject method invokes OracleUdt.SetValue method passing it the con and pUdt parameters. The OracleUdt.SetValue method returns these types of object: