Oracle® Data Provider for .NET Developer's Guide 10g Release 1 (10.1) Part Number B10117-01 |
|
|
View PDF |
This section covers the ODP.NET Type structures.
The OracleBinary
structure represents a variable-length stream of binary data to be stored in or retrieved from a database.
Object
ValueType
OracleBinary
// C# public struct OracleBinary : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Concatenation of the OracleBinary values using + operator OracleBinary ob1a = new OracleBinary(new byte[] {1,2,3}); OracleBinary ob1b = new OracleBinary(new byte[] {4}); OracleBinary ob1 = ob1a + ob1b; OracleBinary ob2 = new OracleBinary(new byte[] {1,2,3,4}); // Output the length if ob1 is equal to ob2 if (ob1 == ob2) Console.WriteLine("The OracleBinary structures are equal with length " + ob1.Length);
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleBinary
members are listed in the following tables:
OracleBinary
constructors are listed in Table 5-1
Table 5-1 OracleBinary Constructors
Constructor | Description |
---|---|
OracleBinary Constructor | Instantiates a new instance of OracleBinary structure |
The OracleBinary
static fields are listed in Table 5-2.
Table 5-2 OracleBinary Static Fields
Field | Description |
---|---|
Null | Represents a null value that can be assigned to an instance of the OracleBinary structure |
The OracleBinary
static methods are listed in Table 5-3.
Table 5-3 OracleBinary Static Methods
Methods | Description |
---|---|
Concat | Returns the concatenation of two OracleBinary structures |
Equals | Determines if two OracleBinary values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleBinary values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleBinary values is greater than or equal to the second |
LessThan | Determines if the first of two OracleBinary values is less than the second |
LessThanOrEqual | Determines if the first of two OracleBinary values is less than or equal to the second |
NotEquals | Determines if two OracleBinary values are not equal |
The OracleBinary
static operators are listed in Table 5-4.
Table 5-4 OracleBinary Static Operators
Operator | Description |
---|---|
operator + | Concatenates two OracleBinary values |
operator == | Determines if two OracleBinary values are equal |
operator > | Determines if the first of two OracleBinary values is greater than the second |
operator >= | Determines if the first of two OracleBinary values is greater than or equal to the second |
operator != | Determines if two OracleBinary values are not equal |
operator < | Determines if the first of two OracleBinary value is less than the second |
operator <= | Determines if the first of two OracleBinary value is less than or equal to the second |
The OracleBinary
static type conversion operators are listed in Table 5-5.
Table 5-5 OracleBinary Static Type Conversion Operators
Operator | Description |
---|---|
explicit operator byte[ ] | Converts an instance value to a byte array |
implicit operator OracleBinary | Converts an instance value to an OracleBinary structure |
The OracleBinary
properties are listed in Table 5-6.
Table 5-6 OracleBinary Properties
Properties | Description |
---|---|
IsNull | Indicates whether the current instance has a null value |
Item | Obtains the particular byte in an OracleBinary structure using an index |
Length | Returns the length of the binary data |
Value | Returns the binary data that is stored in an OracleBinary structure |
The OracleBinary
instance methods are listed in Table 5-7.
Table 5-7 OracleBinary Instance Methods
Methods | Description |
---|---|
CompareTo | Compares the current instance to an object and returns an integer that represents their relative values |
Equals | Determines if two objects contain the same binary data (Overloaded) |
GetHashCode | Returns a hash code for the current instance |
GetType | Inherited from Object |
ToString | Converts the current OracleBinary structure to a string |
The OracleBinary
constructor instantiates a new instance of the OracleBinary
structure and sets its value to the provided array of bytes.
// C# public OracleBinary(byte[ ] bytes);
bytes
A byte array.
The OracleBinary
static fields are listed in Table 5-8.
Table 5-8 OracleBinary Static Fields
Field | Description |
---|---|
Null | Represents a null value that can be assigned to an instance of the OracleBinary structure |
This static field represents a null value that can be assigned to an instance of the OracleBinary
structure.
// C# public static readonly OracleBinary Null;
The OracleBinary
static methods are listed in Table 5-9.
Table 5-9 OracleBinary Static Methods
Methods | Description |
---|---|
Concat | Returns the concatenation of two OracleBinary structures |
Equals | Determines if two OracleBinary values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleBinary values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleBinary values is greater than or equal to the second |
LessThan | Determines if the first of two OracleBinary values is less than the second |
LessThanOrEqual | Determines if the first of two OracleBinary values is less than or equal to the second |
NotEquals | Determines if two OracleBinary values are not equal |
This method returns the concatenation of two OracleBinary
structures.
// C# public static OracleBinary Concat(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
An OracleBinary
.
If either argument has a null value, the returned OracleBinary
structure has a null value.
This method determines if two OracleBinary
values are equal.
// C# public static bool Equals(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if two OracleBinary
values are equal; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines whether the first of two OracleBinary
values is greater than the second.
// C# public static bool GreaterThan(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is greater than the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
// C# OracleBinary ob1 = OracleBinary.Null; OracleBinary ob2 = new OracleBinary(new byte[] {1}); if (OracleBinary.GreaterThan(ob2,ob1)) Console.WriteLine("ob2 > ob1");
This method determines whether the first of two OracleBinary
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is greater than or equal to the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines whether the first of two OracleBinary
values is less than the second.
// C# public static bool LessThan(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is less than the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines whether the first of two OracleBinary
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is less than or equal to the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines whether two OracleBinary
values are not equal.
// C# public static bool NotEquals(OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if two OracleBinary
values are not equal; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
The OracleBinary
static operators are listed in Table 5-10.
Table 5-10 OracleBinary Static Operators
Operator | Description |
---|---|
operator + | Concatenates two OracleBinary values |
operator == | Determines if two OracleBinary values are equal |
operator > | Determines if the first of two OracleBinary values is greater than the second |
operator >= | Determines if the first of two OracleBinary values is greater than or equal to the second |
operator != | Determines if two OracleBinary values are not equal |
operator < | Determines if the first of two OracleBinary value is less than the second |
operator <= | Determines if the first of two OracleBinary value is less than or equal to the second |
This method concatenates two OracleBinary
values.
// C# public static OracleBinary operator + (OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
OracleBinary
If either argument has a null value, the returned OacleBinary
structure has a null value.
This method determines if two OracleBinary
values are equal.
// C# public static bool operator == (OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if they are the same; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines if the first of two OracleBinary
values is greater than the second.
// C# public static bool operator > (OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
// C# OracleBinary ob1 = OracleBinary.Null; OracleBinary ob2 = new OracleBinary(new byte[] {1}); if (ob2 > ob1) Console.WriteLine("ob2 > ob1");
This method determines if the first of two OracleBinary
values is greater than or equal to the second.
// C# public static bool operator >= (OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines if two OracleBinary
values are not equal.
// C# public static bool operator != (OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the two OracleBinary
values are not equal; otherwise, returns false
.
This method determines if the first of two OracleBinary
values is less than the second.
// C# public static bool operator < ( OracleBinary value1, OracleBinary value2);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
This method determines if the first of two OracleBinary
values is less than or equal to the second.
// C# public static bool operator <= (OracleBinary value1, OracleBinary value1);
value1
First OracleBinary
.
value2
Second OracleBinary
.
Returns true
if the first of two OracleBinary
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
The OracleBinary
static type conversion operators are listed in Table 5-11.
Table 5-11 OracleBinary Static Type Conversion Operators
Operator | Description |
---|---|
explicit operator byte[ ] | Converts an instance value to a byte array |
implicit operator OracleBinary | Converts an instance value to an OracleBinary structure |
This method converts an OracleBinary
value to a byte array.
// C# public static explicit operator byte[ ] (OracleBinary val);
val
An OracleBinary
.
A byte array.
OracleNullValueException
- The OracleBinary
structure has a null value.
This method converts a byte array to an OracleBinary
structure.
// C# public static implicit operator OracleBinary(byte[ ] bytes);
bytes
A byte array.
OracleBinary
The OracleBinary
properties are listed in Table 5-12.
Table 5-12 OracleBinary Properties
Properties | Description |
---|---|
IsNull | Indicates whether the current instance has a null value |
Item | Obtains the particular byte in an OracleBinary structure using an index |
Length | Returns the length of the binary data |
Value | Returns the binary data that is stored in an OracleBinary structure |
This property indicates whether the current instance has a null value.
// C# public bool IsNull {get;}
Returns true
if the current instance has a null value; otherwise returns false
.
This property obtains the particular byte
in an OracleBinary
structure using an index.
// C# public byte this[int index] {get;}
A byte in the specified index.
OracleNullValueException
- The current instance has a null value.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {4,3,2,1}); Console.WriteLine(ob1[ob1.Length-1]); // Prints the value 1
This property returns the length of the binary data.
// C# public int length {get;}
Length of the binary data.
OracleNullValueException
- The current instance has a null value.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {4,3,2,1}); Console.WriteLine(ob1.Length); // Prints the value 4
This property returns the binary data that is stored in the OracleBinary
structure.
// C# public byte[] Value {get;}
Binary data.
OracleNullValueException
- The current instance has a null value.
The OracleBinary
instance methods are listed in Table 5-13.
Table 5-13 OracleBinary Instance Methods
Methods | Description |
---|---|
CompareTo | Compares the current instance to an object and returns an integer that represents their relative values |
Equals | Determines if two objects contain the same binary data (Overloaded) |
GetHashCode | Returns a hash code for the current instance |
GetType | Inherited from Object |
ToString | Converts the current OracleBinary structure to a string |
This method compares the current instance to an object and returns an integer that represents their relative values
// C# public int CompareTo(object obj);
obj
The object being compared.
The method returns a number that is:
Less than zero: if the current OracleBinary
instance value is less than obj
.
Zero: if the current OracleBinary
instance and obj
values have the same binary data.
Greater than zero: if the current OracleBinary
instance value is greater than obj
.
IComparable
ArgumentException
- The parameter is not of type OracleBinary
.
The following rules apply to the behavior of this method.
The comparison must be between OracleBinary
s. For example, comparing an OracleBinary
instance with an OracleTimeStamp
instance is not allowed. When an OracleBinary
is compared with a different type, an ArgumentException
is thrown.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
// C# OracleBinary ob1 = new OracleBinary(new byte[] {1,1,1,1}); OracleBinary ob2 = new OracleBinary(new byte[] {1}); // append to ob2 while they are not equal while (ob1.CompareTo(ob2) != 0) ob2 = ob2 + ob2; Console.WriteLine("ob1 == ob2");
This method determines whether an object is an instance of OracleBinary
, and has the same binary data as the current instance.
// C# public override bool Equals(object obj);
obj
The object being compared.
Returns true
if obj
is an instance of OracleBinary
, and has the same binary data as the current instance; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleBinary
that has a value is greater than an OracleBinary
that has a null value.
Two OracleBinary
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleBinary
instance.
// C# public override int GetHashCode();
An int
that represents the hash.
Overrides Object
This method converts an OracleBinary
instance to a string instance.
// C# public override string ToString();
string
If the current OracleBinary
instance has a null value, the returned string "null"
.
The OracleDate
structure represents the Oracle DATE
datatype to be stored in or retrieved from a database. Each OracleDate
stores the following information: year, month, day, hour, minute, and second.
Object
ValueType
OracleDate
// C# public struct OracleDate : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Compute the number of days between minimum values of // the OracleDate and DateTime structures OracleDate od1 = new OracleDate(DateTime.MinValue); OracleDate od2 = OracleDate.MinValue; // Set the nls_date_format for the ToString() OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.DateFormat = "DD-MON-YYYY BC"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine("DateTime.MinValue = " + od1.ToString()); Console.WriteLine("OracleDate.MinValue = " + od2.ToString()); // Compare the two values int result = od1.CompareTo(od2); // Output the difference in number of days (as a positive value) if (result == 0) Console.WriteLine("DateTime and OracleDate Minimum values"+ " are equal."); else if (result < 0) Console.WriteLine("DateTime Minimum value is before OracleDate" + " Minumum value by " + od2.GetDaysBetween(od1) + " days."); else if (result > 0) Console.WriteLine("OracleDate Minimum value is before DateTime" + " Minumum value by " + od1.GetDaysBetween(od2) + " days.");
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleDate
members are listed in the following tables:
OracleDate
constructors are listed in Table 5-14
Table 5-14 OracleDate Constructors
Constructor | Description |
---|---|
OracleDate Constructors | Instantiates a new instance of OracleDate structure (Overloaded) |
The OracleDate
static fields are listed in Table 5-15.
Table 5-15 OracleDate Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid date for an OracleDate structure, which is December 31, 9999 23:59:59 |
MinValue | Represents the minimum valid date for an OracleDate structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to the value of an OracleDate structure instance |
The OracleDate
static methods are listed in Table 5-16.
Table 5-16 OracleDate Static Methods
Methods | Description |
---|---|
Equals | Determines if two OracleDate values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleDate values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleDate values is greater than or equal to the second |
LessThan | Determines if the first of two OracleDate values is less than the second |
LessThanOrEqual | Determines if the first of two OracleDate values is less than or equal to the second |
NotEquals | Determines if two OracleDate values are not equal |
GetSysDate | Returns an OracleDate structure that represents the current date and time |
Parse | Returns an OracleDate structure and sets its value using a string |
The OracleDate
static operators are listed in Table 5-17.
Table 5-17 OracleDate Static Operators
Operator | Description |
---|---|
operator == | Determines if two OracleDate values are the same |
operator > | Determines if the first of two OracleDate values is greater than the second |
operator >= | Determines if the first of two OracleDate values is greater than or equal to the second |
operator != | Determines if the two OracleDate values are not equal |
operator < | Determines if the first of two OracleDate values is less than the second |
operator <= | Determines if the first of two OracleDate values is less than or equal to the second |
The OracleDate
static type conversions are listed in Table 5-18.
Table 5-18 OracleDate Static Type Conversions
Operator | Description |
---|---|
explicit operator DateTime | Converts a structure to a DateTime structure |
explicit operator OracleDate | Converts a structure to an OracleDate structure (Overloaded) |
The OracleDate
properties are listed in Table 5-19.
Table 5-19 OracleDate Properties
Properties | Description |
---|---|
BinData | Gets an array of bytes that represents an Oracle DATE in Oracle internal format |
Day | Gets the day component of an OracleDate method |
IsNull | Indicates whether the current instance has a null value |
Hour | Gets the hour component of an OracleDate |
Minute | Gets the minute component of an OracleDate |
Month | Gets the month component of an OracleDate |
Second | Gets the second component of an OracleDate |
Value | Gets the date and time that is stored in the OracleDate structure |
Year | Gets the year component of an OracleDate |
The OracleDate
methods are listed in Table 5-20.
Table 5-20 OracleDate Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleDate instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same date and time as the current OracleDate instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleDate instance |
GetDaysBetween | Calculates the number of days between the current OracleDate instance and an OracleDate structure |
GetType | Inherited from Object |
ToOracleTimeStamp | Converts the current OracleDate structure to an OracleTimeStamp structure |
ToString | Converts the current OracleDate structure to a string |
The OracleDate
constructors instantiates a new instance of the OracleDate
structure.
This constructor creates a new instance of the OracleDate
structure and sets its value for date and time using the supplied DateTime
value.
This constructor creates a new instance of the OracleDate
structure and sets its value using the supplied string.
This constructor creates a new instance of the OracleDate
structure and set its value for date using the supplied year, month, and day.
OracleDate(int, int, int, int, int, int)
This constructor creates a new instance of the OracleDate
structure and set its value for time using the supplied year, month, day, hour, minute, and second.
This constructor creates a new instance of the OracleDate
structure and sets its value to the provided byte array, which is in the internal Oracle DATE
format.
This constructor creates a new instance of the OracleDate
structure and sets its value for date and time using the supplied DateTime
value.
// C# public OracleDate (DateTime dt);
dt
The provided DateTime
value.
The OracleDate
structure only supports up to a second precision. The time value in the provided DateTime
structure that has a precision smaller than second is ignored.
This constructor creates a new instance of the OracleDate
structure and sets its value using the supplied string.
// C# public OracleDate (string dateStr);
dateStr
A string that represents an Oracle DATE
.
ArgumentException
- The dateStr
is an invalid string representation of an Oracle DATE
or the dateStr
is not in the date format specified by the thread's OracleGlobalization
.DateFormat
property, which represents Oracle's NLS_DATE_FORMAT
parameter.
ArgumentNullException
- The dateStr
is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_date_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.DateFormat = "YYYY-MON-DD"; OracleGlobalization.SetThreadInfo(og); // construct OracleDate from a string using the DateFormat specified. OracleDate od = new OracleDate("1999-NOV-11"); // Set the nls_date_format for the OracleDate(string) constructor og.DateFormat = "DD-MON-YYYY"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(od.ToString()); // Prints 11-NOV-1999
This constructor creates a new instance of the OracleDate
structure and set its value for date using the supplied year, month, and day.
// C# public OracleDate (int year, int month, int day);
year
The supplied year. Range of year
is (-4712 to 9999).
month
The supplied month. Range of month
is (1 to 12).
day
The supplied day. Range of day
is (1 to 31).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleDate
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleDate
structure and set its value for time using the supplied year, month, day, hour, minute, and second.
// C# public OracleDate (int year, int month, int day, int hour, int minute, int second);
year
The supplied year. Range of year
is (-4712 to 9999).
month
The supplied month. Range of month
is (1 to 12).
day
The supplied day. Range of day
is (1 to 31).
hour
The supplied hour. Range of hour
is (0 to 23).
minute
The supplied minute. Range of minute
is (0 to 59).
second
The supplied second. Range of second
is (0 to 59).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleDate
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleDate
structure and sets its value to the provided byte array, which is in the internal Oracle DATE
format.
// C# public OracleDate(byte [] bytes);
bytes
A byte array that represents Oracle DATE
in the internal Oracle DATE
format.
ArgumentException
- bytes
is null or bytes
is not in internal Oracle DATE
format or bytes
is not a valid Oracle DATE
.
The OracleDate
static fields are listed in Table 5-21.
Table 5-21 OracleDate Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid date for an OracleDate structure, which is December 31, 9999 23:59:59 |
MinValue | Represents the minimum valid date for an OracleDate structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to the value of an OracleDate structure instance |
This static field represents the maximum valid date for an OracleDate
structure, which is December 31, 9999 23:59:59.
// C# public static readonly OracleDate MaxValue;
This static field represents the minimum valid date for an OracleDate
structure, which is January 1, -4712.
// C# public static readonly OracleDate MinValue;
This static field represents a null value that can be assigned to the value of an OracleDate
instance.
// C# public static readonly OracleDate Null;
The OracleDate
static methods are listed in Table 5-22.
Table 5-22 OracleDate Static Methods
Methods | Description |
---|---|
Equals | Determines if two OracleDate values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleDate values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleDate values is greater than or equal to the second |
LessThan | Determines if the first of two OracleDate values is less than the second |
LessThanOrEqual | Determines if the first of two OracleDate values is less than or equal to the second |
NotEquals | Determines if two OracleDate values are not equal |
GetSysDate | Returns an OracleDate structure that represents the current date and time |
Parse | Returns an OracleDate structure and sets its value using a string |
Overloads Object
This method determines if two OracleDate
values are equal.
// C# public static bool Equals(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if two OracleDate
values are equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is greater than the second.
// C# public static bool GreaterThan(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is less than the second.
// C# public static bool LessThan(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is less than the second. Otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if two OracleDate
values are not equal.
// C# public static bool NotEquals(OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if two OracleDate
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method gets an OracleDate
structure that represents the current date and time.
// C# public static OracleDate GetSysDate ();
An OracleDate
structure that represents the current date and time.
This method gets an OracleDate
structure and sets its value for date and time using the supplied string.
// C# public static OracleDate Parse (string dateStr);
dateStr
A string that represents an Oracle DATE
.
An OracleDate
structure.
ArgumentException
- The dateStr
is an invalid string representation of an Oracle DATE
or the dateStr
is not in the date format specified by the thread's OracleGlobalization
.DateFormat
property, which represents Oracle's NLS_DATE_FORMAT
parameter.
ArgumentNullException
- The dateStr
is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_date_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.DateFormat = "YYYY-MON-DD"; OracleGlobalization.SetThreadInfo(og); // construct OracleDate from a string using the DateFormat specified. OracleDate od = OracleDate.Parse("1999-NOV-11"); // Set the nls_date_format for the ToString() method og.DateFormat = "DD-MON-YYYY"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(od.ToString()); // Prints 11-NOV-1999
The OracleDate
static operators are listed in Table 5-23.
Table 5-23 OracleDate Static Operators
Operator | Description |
---|---|
operator == | Determines if two OracleDate values are the same |
operator > | Determines if the first of two OracleDate values is greater than the second |
operator >= | Determines if the first of two OracleDate values is greater than or equal to the second |
operator != | Determines if the two OracleDate values are not equal |
operator < | Determines if the first of two OracleDate values is less than the second |
operator <= | Determines if the first of two OracleDate values is less than or equal to the second |
This method determines if two OracleDate
values are the same.
// C# public static bool operator == (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if they are the same; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is greater than the second.
// C# public static bool operator > (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is greater than the second; otherwise, returns false
.
Remarks
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is greater than or equal to the second.
// C# public static bool operator >= (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the two OracleDate
values are not equal.
// C# public static bool operator != (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the two OracleDate
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is less than the second.
// C# public static bool operator < (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines if the first of two OracleDate
values is less than or equal to the second.
// C# public static bool operator <= (OracleDate value1, OracleDate value2);
value1
First OracleDate
.
value2
Second OracleDate
.
Returns true
if the first of two OracleDate
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
The OracleDate
static type conversions are listed in Table 5-24.
Table 5-24 OracleDate Static Type Conversions
Operator | Description |
---|---|
explicit operator DateTime | Converts a structure to a DateTime structure |
explicit operator OracleDate | Converts a structure to an OracleDate structure (Overloaded) |
This method converts an OracleDate
structure to a DateTime
structure.
// C# public static explicit operator DateTime(OracleDate val);
val
An OracleDate
structure.
A DateTime
structure.
explicit operator OracleDate
explicit
operator
OracleDate
converts the provided structure to a OracleDate
structure.
explicit operator OracleDate(DateTime)
This method converts a DateTime
structure to an OracleDate
structure.
explicit operator OracleDate(OracleTimeStamp)
This method converts an OracleTimeStamp
structure to an OracleDate
structure.
explicit operator OracleDate(string)
This method converts the supplied string to an OracleDate
structure.
This method converts a DateTime
structure to an OracleDate
structure.
// C# public static explicit operator OracleDate(DateTime dt);
dt
A DateTime
structure.
An OracleDate
structure.
This method converts an OracleTimeStamp
structure to an OracleDate
structure.
// C# public explicit operator OracleDate(OracleTimeStamp ts);
ts
OracleTimeStamp
The returned OracleDate
structure contains the date and time in the OracleTimeStamp
structure.
The precision of the OracleTimeStamp
value can be lost during the conversion.
If the OracleTimeStamp
structure has a null value, the returned OracleDate
structure also has a null value.
This method converts the supplied string to an OracleDate
structure.
// C# public explicit operator OracleDate (string dateStr);
dateStr
A string representation of an Oracle DATE
.
The returned OracleDate
structure contains the date and time in the string dateStr
.
ArgumentNullException
- The dateStr
is null.
ArgumentException
- This exception is thrown if any of the following conditions exist:
The dateStr
is an invalid string representation of an Oracle DATE
.
The dateStr
is not in the date format specified by the thread's OracleGlobalization
.DateFormat
property, which represents Oracle's NLS_DATE_FORMAT
parameter.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_date_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.DateFormat = "YYYY-MON-DD"; OracleGlobalization.SetThreadInfo(og); // construct OracleDate from a string using the DateFormat specified. OracleDate od = (OracleDate) "1999-NOV-11"; // Set the nls_date_format for the ToString() method og.DateFormat = "DD-MON-YYYY"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(od.ToString()); // Prints 11-NOV-1999
The OracleDate
properties are listed in Table 5-25.
Table 5-25 OracleDate Properties
Properties | Description |
---|---|
BinData | Gets an array of bytes that represents an Oracle DATE in Oracle internal format |
Day | Gets the day component of an OracleDate method |
IsNull | Indicates whether the current instance has a null value |
Hour | Gets the hour component of an OracleDate |
Minute | Gets the minute component of an OracleDate |
Month | Gets the month component of an OracleDate |
Second | Gets the second component of an OracleDate |
Value | Gets the date and time that is stored in the OracleDate structure |
Year | Gets the year component of an OracleDate |
This property gets a array of bytes that represents an Oracle DATE
in Oracle internal format.
// C# public byte[] BinData{get;}
An array of bytes.
OracleNullValueException
- OracleDate
has a null value.
This property gets the day component of an OracleDate
.
// C# public int Day{get;}
A number that represents the day. Range of Day
is (1 to 31).
OracleNullValueException
- OracleDate
has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull{get;}
Returns true
if the current instance has a null value; otherwise, returns false.
This property gets the hour
component of an OracleDate
.
// C# public int Hour {get;}
A number that represents Hour
. Range of Hour
is (0 to 23).
OracleNullValueException
- OracleDate
has a null value.
This property gets the minute component of an OracleDate
.
// C# public int Minute {get;}
A number that represents Minute
. Range of Minute
is (0 to 59).
OracleNullValueException
- OracleDate
has a null value.
This property gets the month
component of an OracleDate.
// C# public int Month {get;}
A number that represents Month
. Range of Month
is (1 to 12).
OracleNullValueException
- OracleDate
has a null value.
This property gets the second
component of an OracleDate.
// C# public int Second {get;}
A number that represents Second
. Range of Second
is (0 to 59).
OracleNullValueException
- OracleDate
has a null value.
This property specifies the date and time that is stored in the OracleDate
structure.
// C# public DateTime Value {get;}
A DateTime
.
OracleNullValueException
- OracleDate
has a null value.
This property gets the year
component of an OracleDate
.
// C# public int Year {get;}
A number that represents Year
. Range of Year
is (-4712 to 9999).
OracleNullValueException
- OracleDate
has a null value.
The OracleDate
methods are listed in Table 5-26.
Table 5-26 OracleDate Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleDate instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same date and time as the current OracleDate instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleDate instance |
GetDaysBetween | Calculates the number of days between the current OracleDate instance and an OracleDate structure |
GetType | Inherited from Object |
ToOracleTimeStamp | Converts the current OracleDate structure to an OracleTimeStamp structure |
ToString | Converts the current OracleDate structure to a string |
This method compares the current OracleDate
instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
An object.
The method returns:
Less than zero: if the current OracleDate
instance value is less than that of obj
.
Zero: if the current OracleDate
instance and obj
values are equal.
Greater than zero: if the current OracleDate
instance value is greater than obj
.
IComparable
ArgumentException
- The obj
parameter is not an instance of OracleDate
.
The following rules apply to the behavior of this method.
The comparison must be between OracleDate
s. For example, comparing an OracleDate
instance with an OracleBinary
instance is not allowed. When an OracleDate
is compared with a different type, an ArgumentException
is thrown.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
This method determines whether an object has the same date and time as the current OracleDate
instance.
// C# public override bool Equals( object obj);
obj
An object.
Returns true
if obj
has the same type as the current instance and represents the same date and time; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleDate
that has a value compares greater than an OracleDate
that has a null value.
Two OracleDate
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleDate
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method calculates the number of days between the current OracleDate
instance and the supplied OracleDate
structure.
// C# public int GetDaysBetween (OracleDate val);
val
An OracleDate
structure.
The number of days between the current OracleDate
instance and the OracleDate
structure.
OracleNullValueException
- The current instance or the supplied OracleDate
structure has a null value.
This method converts the current OracleDate
structure to an OracleTimeStamp
structure.
// C# public OracleTimeStamp ToOracleTimeStamp();
An OracleTimeStamp
structure.
The returned OracleTimeStamp
structure has date and time in the current instance.
If the OracleDate
instance has a null value, the returned OracleTimeStamp
structure has a null value.
Overrides ValueType
This method converts the current OracleDate
structure to a string
.
// C# public override string ToString();
A string.
The returned value is a string representation of the OracleDate
in the format specified by the thread's OracleGlobalization
.DateFormat
property. The names and abbreviations used for months and days are in the language specified by the thread's OracleGlobalization
.DateLanguage
and OracleGlobalization.Calendar
properties. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_date_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.DateFormat = "YYYY-MON-DD"; OracleGlobalization.SetThreadInfo(og); // construct OracleDate from a string using the DateFormat specified. OracleDate od = new OracleDate("1999-NOV-11"); // Set the nls_date_format for the ToString() method og.DateFormat = "DD-MON-YYYY"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(od.ToString()); // Prints 11-NOV-1999
The OracleDecimal
structure represents an Oracle NUMBER
in the database or any Oracle numeric value.
Object
ValueType
OracleDecimal
// C# public struct OracleDecimal : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
OracleDecimal
can store up to 38 precision, while the .NET Decimal
datatype can only hold up to 28 precision. When accessing the OracleDecimal.Value
property from an OracleDecimal
that has a value greater than 28 precision, loss of precision can occur. To retrieve the actual value of OracleDecimal
, use the OracleDecimal.ToString()
method. Another approach is to obtain the OracleDecimal
value as a byte array in an internal Oracle NUMBER
format through the BinData
property.
// C# // Illustrates the usage of OracleDecimal OracleDecimal pi = OracleDecimal.Pi; // Use of implicit operator OracleDecimal(int) OracleDecimal approxPi = OracleDecimal.Divide(22,7); // Round the difference to 5 decimal places OracleDecimal diff=OracleDecimal.Round(OracleDecimal.Abs(pi -approxPi),5); // Set the format for ToString() - display with trailing zeroes diff.Format = "9.9999900"; Console.WriteLine(diff.ToString());
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleDecimal
members are listed in the following tables:
OracleDecimal
constructors are listed in Table 5-27
Table 5-27 OracleDecimal Constructors
Constructor | Description |
---|---|
OracleDecimal Constructors | Instantiates a new instance of OracleDecimal structure (Overloaded) |
The OracleDecimal
static fields are listed in Table 5-28.
Table 5-28 OracleDecimal Static Fields
Field | Description |
---|---|
MaxPrecision | A constant representing the maximum precision, which is 38 |
MaxScale | A constant representing the maximum scale, which is 127 |
MaxValue | A constant representing the maximum value for this structure, which is 9.9…9 x 10125 |
MinScale | A constant representing the minimum scale, which is -84 |
MinValue | A constant representing the minimum value for this structure, which is -1.0 x 10130 |
NegativeOne | A constant representing the negative one value |
Null | Represents a null value that can be assigned to an OracleDecimal instance |
One | A constant representing the positive one value |
Pi | A constant representing the numeric Pi value |
Zero | A constant representing the zero value |
The OracleDecimal
static (comparison) methods are listed in Table 5-29.
Table 5-29 OracleDecimal Static (Comparison) Methods
Methods | Description |
---|---|
Equals | Determines if two OracleDecimal values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleDecimal values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleDecimal values is greater than or equal to the second |
LessThan | Determines if the first of two OracleDecimal values is less than the second |
LessThanOrEqual | Determines if the first of two OracleDecimal values is less than or equal to the second. |
NotEquals | Determines if two OracleDecimal values are not equal |
The OracleDecimal
static (manipulation) methods are listed in Table 5-30.
Table 5-30 OracleDecimal Static (Manipulation) Methods
Methods | Description |
---|---|
Abs | Returns the absolute value of an OracleDecimal |
Add | Adds two OracleDecimal structures |
AdjustScale | Returns a new OracleDecimal with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than original |
Ceiling | Returns a new OracleDecimal structure with its value set to the ceiling of an OracleDecimal structure |
ConvertToPrecScale | Returns a new OracleDecimal structure with a new precision and scale |
Divide | Divides one OracleDecimal value by another |
Floor | Returns a new OracleDecimal structure with its value set to the floor of an OracleDecimal structure |
Max | Returns the maximum value of the two supplied OracleDecimal structures |
Min | Returns the minimum value of the two supplied OracleDecimal structures |
Mod | Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures |
Multiply | Returns a new OracleDecimal structure with its value set to the result of multiplying two OracleDecimal structures |
Negate | Returns a new OracleDecimal structure with its value set to the negation of the supplied OracleDecimal structure |
Parse | Converts a string to an OracleDecimal |
Round | Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure and rounded off to the specified place |
SetPrecision | Returns a new OracleDecimal structure with a new specified precision. |
Shift | Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure, and its decimal place shifted to the specified number of places to the right |
Sign | Determines the sign of an OracleDecimal structure |
Sqrt | Returns a new OracleDecimal structure with its value set to the square root of the supplied OracleDecimal structure |
Subtract | Returns a new OracleDecimal structure with its value set to result of subtracting one OracleDecimal structure from another |
Truncate | Truncates the OracleDecimal at a specified position |
The OracleDecimal
static (logarithmic) methods are listed in Table 5-31.
Table 5-31 OracleDecimal Static (Logarithmic) Methods
Methods | Description |
---|---|
Exp | Returns a new OracleDecimal structure with its value set to e raised to the supplied power |
Log | Returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure (Overloaded) |
Pow | Returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied power (Overloaded) |
The OracleDecimal
static (trigonometric) methods are listed in Table 5-32.
Table 5-32 OracleDecimal Static (Trigonometric) Methods
Methods | Description |
---|---|
Acos | Returns an angle in radian whose cosine is the supplied OracleDecimal structure |
Asin | Returns an angle in radian whose sine is the supplied OracleDecimal structure |
Atan | Returns an angle in radian whose tangent is the supplied OracleDecimal structure |
Atan2 | Returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal structures |
Cos | Returns the cosine of the supplied angle in radian |
Sin | Returns the sine of the supplied angle in radian |
Tan | Returns the tangent of the supplied angle in radian |
Cosh | Returns the hyperbolic cosine of the supplied angle in radian |
Sinh | Returns the hyperbolic sine of the supplied angle in radian |
Tanh | Returns the hyperbolic tangent of the supplied angle in radian |
The OracleDecimal
static (comparison) operators are listed in Table 5-33.
Table 5-33 OracleDecimal Static (Comparison) Operators
Operator | Description |
---|---|
operator + | Adds two OracleDecimal values |
operator / | Divides one OracleDecimal value by another |
operator == | Determines if the two OracleDecimal values are equal |
operator > | Determines if the first of two OracleDecimal values is greater than the second |
operator >= | Determines if the first of two OracleDecimal values is greater than or equal to the second |
operator != | Determines if the two OracleDecimal values are not equal |
operator < | Determines if the first of two OracleDecimal values is less than the second |
operator <= | Determines if the first of two OracleDecimal values is less than or equal to the second |
operator * | Multiplies two OracleDecimal structures |
operator - | Subtracts one OracleDecimal structure from another |
operator - | Negates an OracleDecimal structure |
operator% | Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures. |
The OracleDecimal
static operators (Conversion from .NET Type to OracleDecimal
) are listed in Table 5-34.
Table 5-34 OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)
Operator | Description |
---|---|
implicit operator OracleDecimal | Converts an instance value to an OracleDecimal structure (Overloaded) |
explicit operator OracleDecimal | Converts an instance value to an OracleDecimal structure (Overloaded) |
The OracleDecimal
static operators (Conversion from OracleDecimal
to .NET) are listed in Table 5-35.
Table 5-35 OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)
Operator | Description |
---|---|
explicit operator byte | Returns the byte representation of the OracleDecimal value |
explicit operator decimal | Returns the decimal representation of the OracleDecimal value |
explicit operator double | Returns the double representation of the OracleDecimal value |
explicit operator short | Returns the short representation of the OracleDecimal value |
explicit operator int | Returns the int representation of the OracleDecimal value |
explicit operator long | Returns the long representation of the OracleDecimal value |
explicit operator float | Returns the float representation of the OracleDecimal value |
The OracleDecimal
properties are listed in Table 5-36.
Table 5-36 OracleDecimal Properties
Properties | Description |
---|---|
BinData | Returns a byte array that represents the Oracle NUMBER in Oracle internal format |
Format | Specifies the format for ToString() |
IsInt | Indicates whether the current instance is an integer |
IsNull | Indicates whether the current instance has a null value |
IsPositive | Indicates whether the current instance is greater than 0 |
IsZero | Indicates whether the current instance has a zero value |
Value | Returns a decimal value |
The OracleDecimal
instance methods are listed in Table 5-37.
Table 5-37 OracleDecimal Instance Methods
Method | Description |
---|---|
CompareTo | Compares the current instance to the supplied object and returns an integer that represents their relative values |
Equals | Determines whether an object is an instance of OracleDecimal , and whether the value of the object is equal to the current instance (Overloaded) |
GetHashCode | Returns a hash code for the current instance |
GetType | Inherited from Object |
ToByte | Returns the byte representation of the current instance |
ToDouble | Returns the double representation of the current instance |
ToInt16 | Returns the Int16 representation of the current instance |
ToInt32 | Returns the Int32 representation of the current instance |
ToInt64 | Returns the Int64 representation of the current instance |
ToSingle | Returns the Single representation of the current instance |
ToString | Overloads Object.ToString()
Returns the |
The OracleDecimal
constructors instantiate a new instance of the OracleDecimal
structure.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied byte array, which is in an Oracle NUMBER
format.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Decimal
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied double
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Int32
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Single
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Int64
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied string
value.
This constructor creates a new instance of the OracleDecimal
structure with the supplied string
value and number format.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied byte array, which is in an Oracle NUMBER
format.
// C# public OracleDecimal(byte [] bytes);
bytes
A byte array that represents an Oracle NUMBER
in an internal Oracle format.
ArgumentException
- The bytes
parameter is not in a internal Oracle NUMBER
format or bytes
has an invalid value.
ArgumentNullException
- The bytes
parameter is null.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Decimal
value.
// C# public OracleDecimal(decimal decX);
decX
The provided Decimal
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied double
value.
// C# public OracleDecimal(double doubleX)
doubleX
The provided double value.
OverFlowException
- The value of the supplied double
is greater than the maximum value or less than the minimum value of OracleDecimal
.
OracleDecimal
contains the following values depending on the provided double value:
double.PositiveInfinity
: positive infinity value
double.NegativeInfinity
: negative infinity value.
double.NaN
: null value
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Int32
value.
// C# public OracleDecimal(int intX);
intX
The provided Int32
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Single
value.
// C# public OracleDecimal(float floatX);
floatX
The provided float
value.
OracleDecimal
contains the following values depending on the provided float
value:
float.PositiveInfinity
: positive infinity value
float.NegativeInfinity
: negative infinity value
float.NaN
: null value
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied Int64
value.
// C# public OracleDecimal(long longX);
longX
The provided Int64
value.
This constructor creates a new instance of the OracleDecimal
structure and sets its value to the supplied string
value.
// C# public OracleDecimal(string numStr);
numStr
The provided string
value.
ArgumentException
- The numStr
parameter is an invalid string representation of an OracleDecimal
.
ArgumentNullException
- The numStr
parameter is null.
OverFlowException
- The value of numStr
is greater than the maximum value or less than the minimum value of OracleDecimal
.
This constructor creates a new instance of the OracleDecimal
structure with the supplied string
value and number format.
// C# public OracleDecimal(string numStr, string format);
numStr
The provided string
value.
format
The provided number format
.
ArgumentException
- The numStr
parameter is an invalid string representation of an OracleDecimal
or the numStr
is not in the numeric format specified by format
.
ArgumentNullException
- The numStr
parameter is null.
OverFlowException
- The value of numStr
parameter is greater than the maximum value or less than the minimum value of OracleDecimal
.
If the numeric format includes decimal and group separators, then the provided string must use those characters defined by the OracleGlobalization
.NumericCharacters
of the thread.
If the numeric format includes the currency symbol, ISO currency symbol, or the dual currency symbol, then the provided string must use those symbols defined by the OracleGlobalization.Currency
, OracleGlobalization
.ISOCurrency
, and OracleGlobalization
.DualCurrency
properties respectively.
// C# // Set the nls parameters to be used in the numeric format OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.Currency = "$"; og.NumericCharacters = ".,"; OracleGlobalization.SetThreadInfo(og); // Construct an OracleDecimal using a valid numeric format OracleDecimal od = new OracleDecimal("$2,222.22","L9G999D99"); Console.WriteLine(od.ToString()); // Prints $2,222.22
The OracleDecimal
static fields are listed in Table 5-38.
Table 5-38 OracleDecimal Static Fields
Field | Description |
---|---|
MaxPrecision | A constant representing the maximum precision, which is 38 |
MaxScale | A constant representing the maximum scale, which is 127 |
MaxValue | A constant representing the maximum value for this structure, which is 9.9…9 x 10125 |
MinScale | A constant representing the minimum scale, which is -84 |
MinValue | A constant representing the minimum value for this structure, which is -1.0 x 10130 |
NegativeOne | A constant representing the negative one value |
Null | Represents a null value that can be assigned to an OracleDecimal instance |
One | A constant representing the positive one value |
Pi | A constant representing the numeric Pi value |
Zero | A constant representing the zero value |
This static field represents the maximum precision, which is 38.
// C# public static readonly byte MaxPrecision;
This static field a constant representing the maximum scale, which is 127.
// C# public static readonly byte MaxScale;
This static field indicates a constant representing the maximum value for this structure, which is 9.9…9 x 10125 (38 nines followed by 88 zeroes).
// C# public static readonly OracleDecimal MaxValue;
This static field indicates a constant representing the maximum scale, which is -84.
// C# public static readonly int MinScale;
This static field indicates a constant representing the minimum value for this structure, which is -1.0 x 10130.
// C# public static readonly OracleDecimal MinValue;
This static field indicates a constant representing the negative one value.
// C# public static readonly OracleDecimal NegativeOne;
This static field represents a null value that can be assigned to an OracleDecimal
instance.
// C# public static readonly OracleDecimal Null;
This static field indicates a constant representing the positive one value.
// C# public static readonly OracleDecimal One;
This static field indicates a constant representing the numeric Pi value.
// C# public static readonly OracleDecimal Pi;
This static field indicates a constant representing the zero value.
// C# public static readonly OracleDecimal Zero;
The OracleDecimal
static (comparison) methods are listed in Table 5-39.
Table 5-39 OracleDecimal Static (Comparison) Methods
Methods | Description |
---|---|
Equals | Determines if two OracleDecimal values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleDecimal values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleDecimal values is greater than or equal to the second |
LessThan | Determines if the first of two OracleDecimal values is less than the second |
LessThanOrEqual | Determines if the first of two OracleDecimal values is less than or equal to the second. |
NotEquals | Determines if two OracleDecimal values are not equal |
This method determines if two OracleDecimal
values are equal.
// C# public static bool Equals(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal
.
Returns true
if two OracleDecimal
values are equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is greater than the second.
// C# public static bool GreaterThan(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal.
Returns true
if the first of two OracleDecimal
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is less than the second.
// C# public static bool LessThan(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if two OracleDecimal
values are not equal.
// C# public static bool NotEquals(OracleDecimal value1, OracleDecimal value2);
value1
First OracleDecimal
.
value2
Second OracleDecimal
.
Returns true
if two OracleDecimal
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
The OracleDecimal
static (manipulation) methods are listed in Table 5-40.
Table 5-40 OracleDecimal Static (Manipulation) Methods
Methods | Description |
---|---|
Abs | Returns the absolute value of an OracleDecimal |
Add | Adds two OracleDecimal structures |
AdjustScale | Returns a new OracleDecimal with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than original |
Ceiling | Returns a new OracleDecimal structure with its value set to the ceiling of an OracleDecimal structure |
ConvertToPrecScale | Returns a new OracleDecimal structure with a new precision and scale |
Divide | Divides one OracleDecimal value by another |
Floor | Returns a new OracleDecimal structure with its value set to the floor of an OracleDecimal structure |
Max | Returns the maximum value of the two supplied OracleDecimal structures |
Min | Returns the minimum value of the two supplied OracleDecimal structures |
Mod | Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures |
Multiply | Returns a new OracleDecimal structure with its value set to the result of multiplying two OracleDecimal structures |
Negate | Returns a new OracleDecimal structure with its value set to the negation of the supplied OracleDecimal structure |
Parse | Converts a string to an OracleDecimal |
Round | Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure and rounded off to the specified place |
SetPrecision | Returns a new OracleDecimal structure with a new specified precision. |
Shift | Returns a new OracleDecimal structure with its value set to that of the supplied OracleDecimal structure, and its decimal place shifted to the specified number of places to the right |
Sign | Determines the sign of an OracleDecimal structure |
Sqrt | Returns a new OracleDecimal structure with its value set to the square root of the supplied OracleDecimal structure |
Subtract | Returns a new OracleDecimal structure with its value set to result of subtracting one OracleDecimal structure from another |
Truncate | Truncates the OracleDecimal at a specified position |
This method returns the absolute value of an OracleDecimal
.
// C# public static OracleDecimal Abs(OracleDecimal val);
val
An OracleDecimal
.
The absolute value of an OracleDecimal
.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method adds two OracleDecimal
structures.
// C# public static OracleDecimal Add(OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns an OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
with the specified number of digits and indicates whether or not to round or truncate the number if the scale is less than the original.
// C# public static OracleDecimal AdjustScale(OracleDecimal val, int digits, bool fRound);
val
An OracleDecimal
.
digits
The number of digits.
fRound
Indicates whether to round or truncate the number. Setting it to true
rounds the number and setting it to false
truncates the number.
An OracleDecimal
.
If the supplied OracleDecimal
has a null value, the returned OracleDecimal
has a null value.
// C# OracleDecimal od = new OracleDecimal(5.555); // Adjust Scale to 2 with rounding off OracleDecimal odr = OracleDecimal.AdjustScale(od, 2, true); Console.WriteLine(odr.ToString()); // Prints 5.56 // Adjust Scale to 2 with truncation OracleDecimal odt = OracleDecimal.AdjustScale(od, 2, false); Console.WriteLine(odt.ToString()); // Prints 5.55
This method returns a new OracleDecimal
structure with its value set to the ceiling of the supplied OracleDecimal
.
// C# public static OracleDecimal Ceiling(OracleDecimal val);
val
An OracleDecimal
.
A new OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with a new precision and scale.
// C# public static OracleDecimal ConvertToPrecScale(OracleDecimal val, int precision, int scale);
val
An OracleDecimal
structure.
precision
The precision. Range of precision is 1 to 38.
scale
The number of digits to the right of the decimal point. Range of scale is -84 to 127.
A new OracleDecimal
structure.
If the supplied OracleDecimal
has a null value, the returned OracleDecimal
has a null value.
// C# OracleDecimal od = new OracleDecimal(555.6666); // Set the precision of od to 5 and scale to 2 OracleDecimal odp5s2 = OracleDecimal.ConvertToPrecScale(od,5,2); Console.WriteLine(odp5s2.ToString()); // Prints 555.67 // Set the precision of od to 3 and scale to 0 OracleDecimal odp3s0 = OracleDecimal.ConvertToPrecScale(od,3,0); Console.WriteLine(odp3s0.ToString()); // Prints 556
This method divides one OracleDecimal
value by another.
// C# public static OracleDecimal Divide(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
.
val2
An OracleDecimal
.
A new OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to the floor of the supplied OracleDecimal
structure.
// C# public static OracleDecimal Floor(OracleDecimal val);
val
An OracleDecimal
structure.
A new OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the maximum value of the two supplied OracleDecimal
structures.
// C# public static OracleDecimal Max(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
structure.
val2
An OracleDecimal
structure.
An OracleDecimal
structure that has the greater value.
This method returns the minimum value of the two supplied OracleDecimal
structures.
// C# public static OracleDecimal Min(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
structure.
val2
An OracleDecimal
structure.
An OracleDecimal
structure that has the smaller value.
This method returns a new OracleDecimal
structure with its value set to the modulus of two OracleDecimal
structures.
// C# public static OracleDecimal Mod(OracleDecimal val1, OracleDecimal divider);
val1
An OracleDecimal
structure.
divider
An OracleDecimal
structure.
An OracleDecimal
.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to the result of multiplying two OracleDecimal
structures.
// C# public static OracleDecimal Multiply(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
structure.
val2
An OracleDecimal
structure.
A new OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to the negation of the supplied OracleDecimal
structures.
// C# public static OracleDecimal Negate(OracleDecimal val);
val
An OracleDecimal
structure.
A new OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method converts a string
to an OracleDecimal
.
// C# public static OracleDecimal Parse (string str);
str
The string being converted.
A new OracleDecimal
structure.
ArgumentException
- The numStr
parameter is an invalid string representation of an OracleDecimal
.
ArgumentNullException
- The numStr
parameter is null.
OverFlowException
- The value of numStr
is greater than the maximum value or less than the minimum value of OracleDecimal
.
This method returns a new OracleDecimal
structure with its value set to that of the supplied OracleDecimal
structure and rounded off to the specified place.
// C# public static OracleDecimal Round(OracleDecimal val, int decplace);
val
An OracleDecimal
structure.
decplace
The specified decimal place. If the value is positive, the function rounds the OracleDecimal
structure to the right of the decimal point. If the value is negative, the function rounds to the left of the decimal point.
An OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with a new specified precision.
// C# public static OracleDecimal SetPrecision(OracleDecimal val, int precision);
val
An OracleDecimal
structure.
precision
The specified precision. Range of precision is 1 to 38.
An OracleDecimal
structure.
The returned OracleDecimal
is rounded off if the specified precision is smaller than the precision of val
.
If val
has a null value, the returned OracleDecimal
has a null value.
// C# OracleDecimal od = new OracleDecimal(555.6666); // Set the precision of od to 3 OracleDecimal odp3 = OracleDecimal.SetPrecision(od,3); Console.WriteLine(odp3.ToString()); // Prints 556 // Set the precision of od to 4 OracleDecimal odp4 = OracleDecimal.SetPrecision(od,4); Console.WriteLine(odp4.ToString()); // Prints 555.7
This method returns a new OracleDecimal
structure with its value set to that of the supplied OracleDecimal
structure, and its decimal place shifted to the specified number of places to the right.
// C# public static OracleDecimal Shift(OracleDecimal val, int decplaces);
val
An OracleDecimal
structure.
decplaces
The specified number of places to be shifted.
An OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
If decplaces
is negative, the shift is to the left.
This method determines the sign of an OracleDecimal
structure.
// C# public static int Sign(OracleDecimal val);
val
An OracleDecimal
structure.
-1
: if the supplied OracleDecimal
<
0
0
: if the supplied OracleDecimal
==
0
1
: if the supplied OracleDecimal
>
0
OracleNullValueException
- The argument has a null value.
This method returns a new OracleDecimal
structure with its value set to the square root of the supplied OracleDecimal
structure.
// C# public static OracleDecimal Sqrt(OracleDecimal val);
val
An OracleDecimal
structure.
An OracleDecimal
structure.
ArgumentOutOfRangeException
- The provided OracleDecimal
structure is less than zero.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to result of subtracting one OracleDecimal
structure from another.
// C# public static OracleDecimal Subtract(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
structure.
val2
An OracleDecimal
structure.
An OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method truncates the OracleDecimal
at a specified position.
// C# public static OracleDecimal Truncate(OracleDecimal val, int pos);
val
An OracleDecimal
structure.
pos
The specified position. If the value is positive, the function truncates the OracleDecimal
structure to the right of the decimal point. If the value is negative, it truncates the OracleDecimal
structure to the left of the decimal point.
An OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
The OracleDecimal
static (logarithmic) methods are listed in Table 5-41.
Table 5-41 OracleDecimal Static (Logarithmic) Methods
Methods | Description |
---|---|
Exp | Returns a new OracleDecimal structure with its value set to e raised to the supplied power |
Log | Returns the supplied OracleDecimal structure with its value set to the logarithm of the supplied OracleDecimal structure (Overloaded) |
Pow | Returns a new OracleDecimal structure with its value set to the supplied OracleDecimal structure raised to the supplied power (Overloaded) |
This method returns a new OracleDecimal
structure with its value set to e raised to the supplied OracleDecimal
.
// C# public static OracleDecimal Exp(OracleDecimal val);
val
An OracleDecimal
structure.
An OracleDecimal
structure.
If either argument has a null value, the returned OracleDecimal
has a null value.
Log
Log
returns the supplied OracleDecimal
structure with its value set to the logarithm of the supplied OracleDecimal
structure.
This method returns a new OracleDecimal
structure with its value set to the natural logarithm (base e) of the supplied OracleDecimal
structure.
This method returns the supplied OracleDecimal
structure with its value set to the logarithm of the supplied OracleDecimal
structure in the supplied base.
Log(OracleDecimal, OracleDecimal)
This method returns the supplied OracleDecimal
structure with its value set to the logarithm of the supplied OracleDecimal
structure in the supplied base.
This method returns a new OracleDecimal
structure with its value set to the natural logarithm (base e) of the supplied OracleDecimal
structure.
// C# public static OracleDecimal Log(OracleDecimal val);
val
An OracleDecimal
structure whose logarithm is to be calculated.
Returns a new OracleDecimal
structure with its value set to the natural logarithm (base e) of val
.
ArgumentOutOfRangeException
- The supplied OracleDecimal
value is less than zero.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
If the supplied OracleDecimal
structure has zero value, the result is undefined, and the returned OracleDecimal
structure has a null value.
This method returns the supplied OracleDecimal
structure with its value set to the logarithm of the supplied OracleDecimal
structure in the supplied base.
// C# public static OracleDecimal Log(OracleDecimal val, int logBase);
val
An OracleDecimal
structure whose logarithm is to be calculated.
logBase
An int
that specifies the base of the logarithm.
A new OracleDecimal
structure with its value set to the logarithm of val
in the supplied base.
ArgumentOutOfRangeException
- Either argument is less than zero.
If either argument has a null value, the returned OracleDecimal
has a null value.
If both arguments have zero value, the result is undefined, and the returned OracleDecimal
structure has a null value.
This method returns the supplied OracleDecimal
structure with its value set to the logarithm of the supplied OracleDecimal
structure in the supplied base.
// C# public static OracleDecimal Log(OracleDecimal val, OracleDecimal logBase);
val
An OracleDecimal
structure whose logarithm is to be calculated.
logBase
An OracleDecimal
structure that specifies the base of the logarithm.
Returns the logarithm of val
in the supplied base.
ArgumentOutOfRangeException
- Either the val
or logBase
parameter is less than zero.
If either argument has a null value, the returned OracleDecimal
has a null value.
If both arguments have zero value, the result is undefined, and the returned OracleDecimal
structure has a null value.
Pow
Pow
returns a new OracleDecimal
structure with its value set to the supplied OracleDecimal
structure raised to the supplied power.
This method returns a new OracleDecimal
structure with its value set to the supplied OracleDecimal
value raised to the supplied Int32
power.
Pow(OracleDecimal, OracleDecimal)
This method returns a new OracleDecimal
structure with its value set to the supplied OracleDecimal
structure raised to the supplied OracleDecimal
power.
This method returns a new OracleDecimal
structure with its value set to the supplied OracleDecimal
value raised to the supplied Int32
power.
// C# public static OracleDecimal Pow(OracleDecimal val, int power);
val
An OracleDecimal
structure.
power
An int
value that specifies the power.
An OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to the supplied OracleDecimal
structure raised to the supplied OracleDecimal
power.
// C# public static OracleDecimal Pow(OracleDecimal val, OracleDecimal power);
val
An OracleDecimal
structure.
power
An OracleDecimal
structure that specifies the power.
An OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
The OracleDecimal
static (trigonometric) methods are listed in Table 5-42.
Table 5-42 OracleDecimal Static (Trigonometric) Methods
Methods | Description |
---|---|
Acos | Returns an angle in radian whose cosine is the supplied OracleDecimal structure |
Asin | Returns an angle in radian whose sine is the supplied OracleDecimal structure |
Atan | Returns an angle in radian whose tangent is the supplied OracleDecimal structure |
Atan2 | Returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal structures |
Cos | Returns the cosine of the supplied angle in radian |
Sin | Returns the sine of the supplied angle in radian |
Tan | Returns the tangent of the supplied angle in radian |
Cosh | Returns the hyperbolic cosine of the supplied angle in radian |
Sinh | Returns the hyperbolic sine of the supplied angle in radian |
Tanh | Returns the hyperbolic tangent of the supplied angle in radian |
This method returns an angle in radian whose cosine is the supplied OracleDecimal
structure.
// C# public static OracleDecimal Acos(OracleDecimal val);
val
An OracleDecimal
structure. Range is (-1 to 1).
An OracleDecimal
structure that represents an angle in radian.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns an angle in radian whose sine is the supplied OracleDecimal
structure.
// C# public static OracleDecimal Asin(OracleDecimal val);
val
An OracleDecimal
structure. Range is (-1 to 1).
An OracleDecimal
structure that represents an angle in radian.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns an angle in radian whose tangent is the supplied OracleDecimal
structure
// C# public static OracleDecimal Atan(OracleDecimal val);
val
An OracleDecimal
.
An OracleDecimal
structure that represents an angle in radian.
If the argument has a null value, the returned OracleDecimal
has a null value.
This method returns an angle in radian whose tangent is the quotient of the two supplied OracleDecimal
structures.
// C# public static OracleDecimal Atan2(OracleDecimal val1, OracleDecimal val2);
val1
An OracleDecimal
structure that represents the y-coordinate.
val2
An OracleDecimal
structure that represents the x-coordinate.
An OracleDecimal
structure that represents an angle in radian.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the cosine of the supplied angle in radian.
// C# public static OracleDecimal Cos(OracleDecimal val);
val
An OracleDecimal
structure that represents an angle in radian.
An OracleDecimal
instance.
ArgumentOutOfRangeException
- The val
parameter is positive or negative infinity.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the sine of the supplied angle in radian.
// C# public static OracleDecimal Sin(OracleDecimal val);
val
An OracleDecimal
structure.
An OracleDecimal
structure that represents an angle in radian.
ArgumentOutOfRangeException
- The val
parameter is positive or negative infinity.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the tangent of the supplied angle in radian.
// C# public static OracleDecimal Tan(OracleDecimal val);
val
An OracleDecimal
structure that represents an angle in radian.
An OracleDecimal
instance.
ArgumentOutOfRangeException
- The val
parameter is positive or negative infinity.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the hyperbolic cosine of the supplied angle in radian.
// C# public static OracleDecimal Cosh(OracleDecimal val);
val
An OracleDecimal
structure that represents an angle in radian.
An OracleDecimal
instance.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the hyperbolic sine of the supplied angle in radian.
// C# public static OracleDecimal Sinh(OracleDecimal val);
val
An OracleDecimal
structure that represents an angle in radian.
An OracleDecimal
instance.
If either argument has a null value, the returned OracleDecimal
has a null value.
This method returns the hyperbolic tangent of the supplied angle in radian.
// C# public static OracleDecimal Tanh(OracleDecimal val);
val
An OracleDecimal
structure that represents an angle in radian.
An OracleDecimal
instance.
If either argument has a null value, the returned OracleDecimal
has a null value.
The OracleDecimal
static (comparison) operators are listed in Table 5-43.
Table 5-43 OracleDecimal Static (Comparison) Operators
Operator | Description |
---|---|
operator + | Adds two OracleDecimal values |
operator / | Divides one OracleDecimal value by another |
operator == | Determines if the two OracleDecimal values are equal |
operator > | Determines if the first of two OracleDecimal values is greater than the second |
operator >= | Determines if the first of two OracleDecimal values is greater than or equal to the second |
operator != | Determines if the two OracleDecimal values are not equal |
operator < | Determines if the first of two OracleDecimal values is less than the second |
operator <= | Determines if the first of two OracleDecimal values is less than or equal to the second |
operator * | Multiplies two OracleDecimal structures |
operator - | Subtracts one OracleDecimal structure from another |
operator - | Negates an OracleDecimal structure |
operator% | Returns a new OracleDecimal structure with its value set to the modulus of two OracleDecimal structures. |
This method adds two OracleDecimal
values.
// C# public static OracleDecimal operator + (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
An OracleDecimal
structure.
If either operand has a null value, the returned OracleDecimal
has a null value.
This method divides one OracleDecimal
value by another.
// C# public static OracleDecimal operator / (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
An OracleDecimal
structure.
If either operand has a null value, the returned OracleDecimal
has a null value.
This method determines if two OracleDecimal
values are equal.
// C# public static bool operator == (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if their values are equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is greater than the second.
// C# public static bool operator > (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if the two OracleDecimal
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is greater than or equal to the second.
// C# public static bool operator >= (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values are not equal.
// C# public static bool operator != (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if the two OracleDecimal
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is less than the second.
// C# public static bool operator < (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method determines if the first of two OracleDecimal
values is less than or equal to the second.
// C# public static bool operator <= (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
Returns true
if the first of two OracleDecimal
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
This method multiplies two OracleDecimal
structures.
// C# public static OracleDecimal operator * (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
A new OracleDecimal
structure.
If either operand has a null value, the returned OracleDecimal
has a null value.
This method subtracts one OracleDecimal
structure from another.
// C# public static OracleDecimal operator - (OracleDecimal val1, OracleDecimal val2);
val1
First OracleDecimal
.
val2
Second OracleDecimal
.
A new OracleDecimal
structure.
If either operand has a null value, the returned OracleDecimal
has a null value.
This method negates the supplied OracleDecimal
structure.
// C# public static OracleDecimal operator - (OracleDecimal val);
val
An OracleDecimal
.
A new OracleDecimal
structure.
If the supplied OracleDecimal
structure has a null value, the returned OracleDecimal
has a null value.
This method returns a new OracleDecimal
structure with its value set to the modulus of two OracleDecimal
structures.
// C# public static OracleDecimal operator % (OracleDecimal val, OracleDecimal divider);
val
An OracleDecimal
.
divider
An OracleDecimal
.
A new OracleDecimal
structure.
If either operand has a null value, the returned OracleDecimal
has a null value.
The OracleDecimal
static operators (Conversion from .NET Type to OracleDecimal
) are listed in Table 5-44.
Table 5-44 OracleDecimal Static Operators (Conversion from .NET Type to OracleDecimal)
Operator | Description |
---|---|
implicit operator OracleDecimal | Converts an instance value to an OracleDecimal structure (Overloaded) |
explicit operator OracleDecimal | Converts an instance value to an OracleDecimal structure (Overloaded) |
implicit operator OracleDecimal
implicit
operator
OracleDecimal
returns the OracleDecimal
representation of a value.
implicit operator OracleDecimal(decimal)
This method returns the OracleDecimal
representation of a decimal
value.
implicit operator OracleDecimal(int)
This method returns the OracleDecimal
representation of an int
value.
implicit operator OracleDecimal(long)
This method returns the OracleDecimal
representation of a long
value.
This method returns the OracleDecimal
representation of a decimal
value.
// C# public static implicit operator OracleDecimal(decimal val);
val
A decimal
value.
An OracleDecimal
.
This method returns the OracleDecimal
representation of an int
value.
// C# public static implicit operator OracleDecimal(int val);
val
An int
value.
An OracleDecimal
.
This method returns the OracleDecimal
representation of a long
value.
// C# public static implicit operator OracleDecimal(long val);
val
A long
value.
An OracleDecimal
.
explicit operator OracleDecimal
OracleDecimal
returns the OracleDecimal
representation of a value.
explicit operator OracleDecimal(double)
This method returns the OracleDecimal
representation of a double.
explicit operator OracleDecimal(string)
This method returns the OracleDecimal
representation of a string.
This method returns the OracleDecimal
representation of a double.
// C# public static explicit operator OracleDecimal(double val);
val
A double
.
An OracleDecimal
.
OverFlowException
- The value of the supplied double
is greater than the maximum value of OracleDecimal
or less than the minimum value of OracleDecimal
.
OracleDecimal
contains the following values depending on the provided double value:
double.PositiveInfinity
: positive infinity value
double.NegativeInfinity
: negative infinity value.
double.NaN
: null value
This method returns the OracleDecimal
representation of a string.
// C# public static explicit operator OracleDecimal(string numStr);
numStr
A string
that represents a numeric value.
An OracleDecimal
.
ArgumentException
- The numStr
parameter is an invalid string representation of an OracleDecimal
.
The OracleDecimal
static operators (Conversion from OracleDecimal
to .NET) are listed in Table 5-45.
Table 5-45 OracleDecimal Static Operators (Conversion from OracleDecimal to .NET)
Operator | Description |
---|---|
explicit operator byte | Returns the byte representation of the OracleDecimal value |
explicit operator decimal | Returns the decimal representation of the OracleDecimal value |
explicit operator double | Returns the double representation of the OracleDecimal value |
explicit operator short | Returns the short representation of the OracleDecimal value |
explicit operator int | Returns the int representation of the OracleDecimal value |
explicit operator long | Returns the long representation of the OracleDecimal value |
explicit operator float | Returns the float representation of the OracleDecimal value |
This method returns the byte
representation of the OracleDecimal
value.
// C# public static explicit operator byte(OracleDecimal val);
val
An OracleDecimal
structure.
A byte
.
OracleNullValueException
- OracleDecimal
has a null value.
OverFlowException
- The byte
cannot represent the supplied OracleDecimal
structure.
This method returns the decimal
representation of the OracleDecimal
value.
// C# public static explicit operator decimal(OracleDecimal val);
val
An OracleDecimal
structure.
A decimal
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The decimal
cannot represent the supplied OracleDecimal
structure.
This method returns the double
representation of the OracleDecimal
value.
// C# public static explicit operator double(OracleDecimal val);
val
An OracleDecimal
structure.
A double
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The double
cannot represent the supplied OracleDecimal
structure.
This method returns the short
representation of the OracleDecimal
value.
// C# public static explicit operator short(OracleDecimal val);
val
An OracleDecimal
structure.
A short
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The short
cannot represent the supplied OracleDecimal
structure.
This method returns the int
representation of the OracleDecimal
value.
// C# public static explicit operator int(OracleDecimal val);
val
An OracleDecimal
structure.
An int
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The int
cannot represent the supplied OracleDecimal
structure.
This method returns the long
representation of the OracleDecimal
value.
// C# public static explicit operator long(OracleDecimal val);
val
An OracleDecimal
structure.
A long
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The long
cannot represent the supplied OracleDecimal
structure.
This method returns the float
representation of the OracleDecimal
value.
// C# public static explicit operator float(OracleDecimal val);
val
An OracleDecimal
structure.
A float
.
OracleNullValueException
- The OracleDecimal
has a null value.
OverFlowException
- The float
cannot represent the supplied OracleDecimal
structure.
The OracleDecimal
properties are listed in Table 5-46.
Table 5-46 OracleDecimal Properties
Properties | Description |
---|---|
BinData | Returns a byte array that represents the Oracle NUMBER in Oracle internal format |
Format | Specifies the format for ToString() |
IsInt | Indicates whether the current instance is an integer |
IsNull | Indicates whether the current instance has a null value |
IsPositive | Indicates whether the current instance is greater than 0 |
IsZero | Indicates whether the current instance has a zero value |
Value | Returns a decimal value |
This property returns a byte array that represents the Oracle NUMBER
in an internal Oracle format.
// C# public byte[] BinData {get;}
A byte array that represents the Oracle NUMBER
in an internal Oracle format.
OracleNullValueException
- The current instance has a null value.
This property specifies the format for ToString()
.
// C# public string Format {get; set;}
The string which specifies the format.
Format
is used when ToString()
is called on an instance of an OracleDecimal
. It is useful if the ToString()
method needs a specific currency symbol, group, or decimal separator as part of a string.
By default, this property is null
which indicates that no special formatting is used.
The decimal and group separator characters are specified by the thread's OracleGlobalization.NumericCharacters
.
The currency symbols are specified by the following thread properties:
OracleGlobalization.Currency
OracleGlobalization.ISOCurrency
OracleGlobalization.DualCurrency
This property indicates whether the current instance is an integer value.
// C# public bool IsInt {get;}
A bool
value that returns true
if the current instance is an integer value; otherwise, returns false
.
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull {get;}
A bool
value that returns true
if the current instance has a null value; otherwise, returns false
.
This property indicates whether the value of the current instance is greater than 0
.
// C# public bool IsPositive {get;}
A bool
value that returns true
if the current instance is greater than 0
; otherwise, returns false
.
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a zero value.
// C# public bool IsZero{get;}
A bool
value that returns true
if the current instance has a zero value; otherwise, returns false
.
OracleNullValueException
- The current instance has a null value.
This method returns a decimal
value.
// C# public decimal Value {get;}
A decimal
value.
OracleNullValueException
- The current instance has a null value.
OverFlowException
- The decimal
cannot represent the supplied OracleDecimal
structure.
Precision can be lost when the decimal
value is obtained from an OracleDecimal
. See Remarks under "OracleDecimal Structure" for further information.
The OracleDecimal
instance methods are listed in Table 5-47.
Table 5-47 OracleDecimal Instance Methods
Method | Description |
---|---|
CompareTo | Compares the current instance to the supplied object and returns an integer that represents their relative values |
Equals | Determines whether an object is an instance of OracleDecimal , and whether the value of the object is equal to the current instance (Overloaded) |
GetHashCode | Returns a hash code for the current instance |
GetType | Inherited from Object |
ToByte | Returns the byte representation of the current instance |
ToDouble | Returns the double representation of the current instance |
ToInt16 | Returns the Int16 representation of the current instance |
ToInt32 | Returns the Int32 representation of the current instance |
ToInt64 | Returns the Int64 representation of the current instance |
ToSingle | Returns the Single representation of the current instance |
ToString | Overloads Object.ToString()
Returns the |
This method compares the current instance to the supplied object and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The supplied instance.
The method returns a number:
Less than zero: if the value of the current instance is less than obj
.
Zero: if the value of the current instance is equal to obj
.
Greater than zero: if the value of the current instance is greater than obj
.
IComparable
ArgumentException
- The parameter is not of type OracleDecimal
.
The following rules apply to the behavior of this method.
The comparison must be between OracleDecimal
s. For example, comparing an OracleDecimal
instance with an OracleBinary
instance is not allowed. When an OracleDecimal
is compared with a different type, an ArgumentException
is thrown.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
Overrides Object
This method determines whether an object is an instance of OracleDecimal
, and whether the value of the object is equal to the current instance.
// C# public override bool Equals(object obj);
obj
An OracleDecimal
instance.
Returns true
if obj
is an instance of OracleDecimal
, and the value of obj
is equal to the current instance; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleDecimal
that has a value compares greater than an OracleDecimal
that has a null value.
Two OracleDecimal
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the current instance.
// C# public override int GetHashCode();
Returns a hash code.
This method returns the byte
representation of the current instance.
// C# public byte ToByte();
A byte
.
OverFlowException
- The byte
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
This method returns the double
representation of the current instance.
// C# public double ToDouble();
A double
.
OverFlowException
- The double
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
This method returns the Int16
representation of the current instance.
// C# public short ToInt16();
A short
.
OverFlowException
- The short
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
This method returns the Int32
representation of the current instance.
// C# public int ToInt32();
An int
.
OverFlowException
- The int
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
This method returns the Int64
representation of the current instance.
// C# public long ToInt64();
A long
.
OverFlowException
- The long
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
This method returns the Single
representation of the current instance.
// C# public float ToSingle();
A float
.
OverFlowException
- The float
cannot represent the current instance.
OracleNullValueException
- The current instance has a null value.
Overrides Object
This method returns the string
representation of the current instance.
// C# public override string ToString();
Returns the number in a string.
If the current instance has a null value, the returned string is "null".
The returned value is a string representation of an OracleDecimal
in the numeric format specified by the Format
property.
The decimal and group separator characters are specified by the thread's OracleGlobalization
.NumericCharacters
.
The currency symbols are specified by the following thread properties:
OracleGlobalization.Currency
OracleGlobalization
.ISOCurrency
OracleGlobalization
.DualCurrency
If the numeric format is not specified, an Oracle default value is used.
The OracleIntervalDS
structure represents the Oracle INTERVAL
DAY
TO
SECOND
datatype to be stored in or retrieved from a database. Each OracleIntervalDS
stores a period of time in term of days, hours, minutes, seconds, and fractional seconds.
Object
ValueType
OracleIntervalDS
// C# public struct OracleIntervalDS : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleIntervalDS OracleIntervalDS idsMax = OracleIntervalDS.MaxValue; double maxDays = idsMax.TotalDays; maxDays -= 1; OracleIntervalDS idsMax_1 = new OracleIntervalDS(maxDays); // Calculate the difference. It should be 1 +/- epsilon days // where epsilon for OracleIntervalDS = 0.000000001 seconds. OracleIntervalDS idsDiff = idsMax - idsMax_1; // If the difference isnt exactly 1 day, display the difference if (idsDiff.TotalDays != 1) Console.WriteLine(idsDiff.ToString());
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleIntervalDS
members are listed in the following tables:
OracleIntervalDS
constructors are listed in Table 5-48
Table 5-48 OracleIntervalDS Constructors
Constructor | Description |
---|---|
OracleIntervalDS Constructors | Instantiates a new instance of OracleIntervalDS structure (Overloaded) |
The OracleIntervalDS
static fields are listed in Table 5-49.
Table 5-49 OracleIntervalDS Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid time interval for an OracleIntervalDS structure |
MinValue | Represents the minimum valid time interval for an OracleIntervalDS structure |
Null | Represents a null value that can be assigned to an OracleIntervalDS instance |
Zero | Represents a zero value for an OracleIntervalDS structure |
The OracleIntervalDS
static methods are listed in Table 5-50.
Table 5-50 OracleIntervalDS Static Methods
Methods | Description |
---|---|
Equals | Determines whether two OracleIntervalDS values are equal (Overloaded) |
GreaterThan | Determines whether one OracleIntervalDS value is greater than another |
GreaterThanOrEqual | Determines whether one OracleIntervalDS value is greater than or equal to another |
LessThan | Determines whether one OracleIntervalDS value is less than another |
LessThanOrEqual | Determines whether one OracleIntervalDS value is less than or equal to another |
NotEquals | Determines whether two OracleIntervalDS values are not equal |
Parse | Returns an OracleIntervalDS structure and sets its value for time interval using a string |
SetPrecision | Returns a new instance of an OracleIntervalDS with the specified day precision and fractional second precision |
The OracleIntervalDS
static operators are listed in Table 5-51.
Table 5-51 OracleIntervalDS Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalDS values |
operator == | Determines whether two OracleIntervalDS values are equal |
operator > | Determines whether one OracleIntervalDS value is greater than another |
operator >= | Determines whether one OracleIntervalDS value is greater than or equal to another |
operator != | Determines whether two OracleIntervalDS values are not equal |
operator < | Determines whether one OracleIntervalDS value is less than another |
operator <= | Determines whether one OracleIntervalDS value is less than or equal to another |
operator - | Subtracts one OracleIntervalDS value from another |
operator - | Negates an OracleIntervalDS structure |
operator * | Multiplies an OracleIntervalDS value by a number |
operator / | Divides an OracleIntervalDS value by a number |
The OracleIntervalDS
type conversions are listed in Table 5-52.
Table 5-52 OracleIntervalDS Type Conversions
Operator | Description |
---|---|
explicit operator TimeSpan | Converts an OracleIntervalDS structure to a TimeSpan structure |
explicit operator OracleIntervalDS | Converts a string to an OracleIntervalDS structure |
implicit operator OracleIntervalDS | Converts a TimeSpan structure to an OracleIntervalDS structure |
The OracleIntervalDS
properties are listed in Table 5-53.
Table 5-53 OracleIntervalDS Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents the Oracle INTERVAL DAY TO SECOND in Oracle internal format |
Days | Gets the days component of an OracleIntervalDS |
Hours | Gets the hours component of an OracleIntervalDS |
IsNull | Indicates whether the current instance has a null value |
Milliseconds | Gets the milliseconds component of an OracleIntervalDS |
Minutes | Gets the minutes component of an OracleIntervalDS |
Nanoseconds | Gets the nanoseconds component of an OracleIntervalDS |
Seconds | Gets the seconds component of an OracleIntervalDS |
TotalDays | Returns the total number, in days, that represent the time period in the OracleIntervalDS structure |
Value | Specifies the time interval that is stored in the OracleIntervalDS structure |
The OracleIntervalDS
methods are listed in Table 5-54.
Table 5-54 OracleIntervalDS Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleIntervalDS instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether the specified object has the same time interval as the current instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleIntervalDS instance |
GetType | Inherited from Object |
ToString | Converts the current OracleIntervalDS structure to a string |
OracleIntervalDS
constructors create a new instance of the OracleIntervalDS
structure.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using a TimeSpan
structure.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using a string that indicates a period of time.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the total number of days.
OracleIntervalDS(int, int, int, int, double)
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the supplied days, hours, minutes, seconds and milliseconds.
OracleIntervalDS(int, int, int, int, int)
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the supplied days, hours, minutes, seconds, and nanoseconds.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value to the provided byte array, which is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using a TimeSpan
structure.
// C# public OracleIntervalDS(TimeSpan ts);
ts
A TimeSpan
structure.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using a string that indicates a period of time.
// C# public OracleIntervalDS(string intervalStr);
intervalStr
A string representing the Oracle INTERVAL
DAY
TO
SECOND
.
ArgumentException
- The intervalStr
parameter is not in the valid format or has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
The value specified in the supplied intervalStr
must be in Day HH:MI:SSxFF format.
"1 2:3:4.99" means 1 day, 2 hours, 3 minutes, 4 seconds, and 990 milliseconds or 1 day, 2 hours, 3 minutes, 4 seconds, and 990000000 nanoseconds.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the total number of days.
// C# public OracleIntervalDS(double totalDays);
totalDays
The supplied total number of days for a time interval. Range of days is -1000,000,000 < totalDays
< 1000,000,000.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleIntervalDS
.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the supplied days, hours, minutes, seconds, and milliseconds.
// C# public OracleIntervalDS (int days, int hours, int minutes, int seconds, double milliSeconds);
days
The days provided. Range of day is (-999,999,999 to 999,999,999).
hours
The hours provided. Range of hour is (-23 to 23).
minutes
The minutes provided. Range of minute is (-59 to 59).
seconds
The seconds provided. Range of second is (-59 to 59).
milliSeconds
The milliseconds provided. Range of millisecond is (- 999.999999 to 999.999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleIntervalDS
.
The sign of all the arguments must be the same.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value using the supplied days, hours, minutes, seconds, and nanoseconds.
// C# public OracleIntervalDS (int days, int hours, int minutes, int seconds, int nanoseconds);
days
The days provided. Range of day is (-999,999,999 to 999,999,999).
hours
The hours provided. Range of hour is (-23 to 23).
minutes
The minutes provided. Range of minute is (-59 to 59).
seconds
The seconds provided. Range of second is (-59 to 59).
nanoseconds
The nanoseconds provided. Range of nanosecond is (-999,999,999 to 999,999,999)
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleIntervalDS
.
The sign of all the arguments must be the same.
This constructor creates a new instance of the OracleIntervalDS
structure and sets its value to the provided byte array, which is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
// C# public OracleIntervalDS (byte[ ] bytes);
bytes
A byte array that is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
ArgumentException
- bytes
is not in internal Oracle INTERVAL
DAY
TO
SECOND
format, or bytes
is not a valid Oracle INTERVAL
DAY
TO
SECOND
.
ArgumentNullException
- bytes
is null.
The OracleIntervalDS
static fields are listed in Table 5-55.
Table 5-55 OracleIntervalDS Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid time interval for an OracleIntervalDS structure |
MinValue | Represents the minimum valid time interval for an OracleIntervalDS structure |
Null | Represents a null value that can be assigned to an OracleIntervalDS instance |
Zero | Represents a zero value for an OracleIntervalDS structure |
This static field represents the maximum value for an OracleIntervalDS
structure.
// C# public static readonly OracleIntervalDS MaxValue;
Maximum values:
Day: 999999999
hour: 23
minute is 59
second: 59
nanosecond: 999999999
This static field represents the minimum value for an OracleIntervalDS
structure.
// C# public static readonly OracleIntervalDS MinValue;
Minimum values:
Day: -999999999
hour: -23
minute: -59
second: -59
nanosecond: -999999999
This static field represents a null value that can be assigned to an OracleIntervalDS
instance.
// C# public static readonly OracleIntervalDS Null;
This static field represents a zero value for an OracleIntervalDS
structure.
// C# public static readonly OracleIntervalDS Zero;
The OracleIntervalDS
static methods are listed in Table 5-56.
Table 5-56 OracleIntervalDS Static Methods
Methods | Description |
---|---|
Equals | Determines whether two OracleIntervalDS values are equal (Overloaded) |
GreaterThan | Determines whether one OracleIntervalDS value is greater than another |
GreaterThanOrEqual | Determines whether one OracleIntervalDS value is greater than or equal to another |
LessThan | Determines whether one OracleIntervalDS value is less than another |
LessThanOrEqual | Determines whether one OracleIntervalDS value is less than or equal to another |
NotEquals | Determines whether two OracleIntervalDS values are not equal |
Parse | Returns an OracleIntervalDS structure and sets its value for time interval using a string |
SetPrecision | Returns a new instance of an OracleIntervalDS with the specified day precision and fractional second precision |
This static method determines whether two OracleIntervalDS
values are equal.
// C# public static bool Equals(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
If the two OracleIntervalDS
structures represent the same time interval, returns true
; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalDS
values is greater than the second.
// C# public static bool GreaterThan(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalDS
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalDS
values is less than the second.
// C# public static bool LessThan(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalDS
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method determines whether two OracleIntervalDS
values are not equal.
// C# public static bool NotEquals(OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if two OracleIntervalDS
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static method returns an OracleIntervalDS
instance and sets its value for time interval using a string.
// C# public static OracleIntervalDS Parse(string intervalStr);
intervalStr
A string representing the Oracle INTERVAL
DAY
TO
SECOND
.
Returns an OracleIntervalDS
instance representing the time interval from the supplied string.
ArgumentException
- The intervalStr
parameter is not in the valid format or intervalStr
has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
The value specified in intervalStr
must be in Day HH:MI:SSxFF format.
"1
2:3:4.99
" means 1 day, 2 hours, 3 minutes, 4 seconds, and 990 milliseconds or 1 day, 2 hours, 3 minutes, 4 seconds, and 990000000 nanoseconds.
This static method returns a new instance of an OracleIntervalDS
with the specified day precision and fractional second precision.
// C# public static OracleIntervalDS SetPrecision(OracleIntervalDS value1,int dayPrecision, int fracSecPrecision);
value1
An OracleIntervalDS
structure.
dayPrecision
The day precision provided. Range of day precision is (0 to 9).
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleIntervalDS
instance.
ArgumentOutOfRangeException
- An argument value is out of the specified range.
Depending on the value specified in the supplied dayPrecision
, 0 or more leading zeros are displayed in the string returned by ToString()
.
The value specified in the supplied fracSecPrecision
is used to perform a rounding off operation on the supplied OracleIntervalDS
value. Depending on this value, 0
or more trailing zeros are displayed in the string returned by ToString()
.
The OracleIntervalDS
with a value of "1
2:3:4.99
" results in the string "001
2:3:4.99000
" when SetPrecision()
is called, with the day precision set to 3
and fractional second precision set to 5
.
The OracleIntervalDS
static operators are listed in Table 5-57.
Table 5-57 OracleIntervalDS Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalDS values |
operator == | Determines whether two OracleIntervalDS values are equal |
operator > | Determines whether one OracleIntervalDS value is greater than another |
operator >= | Determines whether one OracleIntervalDS value is greater than or equal to another |
operator != | Determines whether two OracleIntervalDS values are not equal |
operator < | Determines whether one OracleIntervalDS value is less than another |
operator <= | Determines whether one OracleIntervalDS value is less than or equal to another |
operator - | Subtracts one OracleIntervalDS value from another |
operator - | Negates an OracleIntervalDS structure |
operator * | Multiplies an OracleIntervalDS value by a number |
operator / | Divides an OracleIntervalDS value by a number |
This static operator adds two OracleIntervalDS
values.
// C# public static OracleIntervalDS operator + (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
An OracleIntervalDS.
If either argument has a null value, the returned OracleIntervalDS
structure has a null value.
This static operator determines if two OracleIntervalDS
values are equal.
// C# public static bool operator == (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the two OracleIntervalDS
values are the same; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalDS
values is greater than the second.
// C# public static bool operator > (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if one OracleIntervalDS
value is greater than another; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalDS
values is greater than or equal to the second.
// C# public static bool operator >= (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator determines if the two OracleIntervalDS
values are not equal.
// C# public static bool operator != (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the two OracleIntervalDS
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalDS
values is less than the second.
// C# public static bool operator < (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalDS
values is less than or equal to the second.
// C# public static bool operator <= (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
Returns true
if the first of two OracleIntervalDS
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This static operator subtracts one OracleIntervalDS
structure from another.
// C# public static OracleIntervalDS operator - (OracleIntervalDS val1, OracleIntervalDS val2);
val1
First OracleIntervalDS
.
val2
Second OracleIntervalDS
.
An OracleIntervalDS
structure.
If either argument has a null value, the returned OracleIntervalDS
structure has a null value.
This static operator negates the supplied OracleIntervalDS
structure.
// C# public static OracleIntervalDS operator - (OracleIntervalDS val);
val
An OracleIntervalDS
.
An OracleIntervalDS
structure.
If the supplied OracleIntervalDS
structure has a null value, the returned OracleIntervalDS
structure has a null value.
This static operator multiplies an OracleIntervalDS
value by a number.
// C# public static OracleIntervalDS operator * (OracleIntervalDS val1, int multiplier);
val1
First OracleIntervalDS
.
multiplier
A multiplier.
A new OracleIntervalDS
instance.
If the OracleIntervalDS
structure has a null value, the returned OracleIntervalDS
structure has a null value.
This static operator divides an OracleIntervalDS
value by a number.
// C# public static OracleIntervalDS operator / (OracleIntervalDS val1, int divisor);
val1
First OracleIntervalDS
.
divisor
A divisor.
An OracleIntervalDS
structure.
If the OracleIntervalDS
structure has a null value, the returned OracleIntervalDS
structure has a null value.
The OracleIntervalDS
type conversions are listed in Table 5-58.
Table 5-58 OracleIntervalDS Type Conversions
Operator | Description |
---|---|
explicit operator TimeSpan | Converts an OracleIntervalDS structure to a TimeSpan structure |
explicit operator OracleIntervalDS | Converts a string to an OracleIntervalDS structure |
implicit operator OracleIntervalDS | Converts a TimeSpan structure to an OracleIntervalDS structure |
This type conversion operator converts an OracleIntervalDS
structure to a TimeSpan
structure.
// C# public static explicit operator TimeSpan(OracleIntervalDS val);
val
An OracleIntervalDS
instance.
A TimeSpan
structure.
OracleNullValueException
- The OracleIntervalDS
structure has a null value.
This type conversion operator converts a string to an OracleIntervalDS
structure.
// C# public static explicit operator OracleIntervalDS (string intervalStr);
intervalStr
A string representation of an Oracle INTERVAL
DAY
TO
SECOND
.
An OracleIntervalDS
structure.
ArgumentException
- The supplied intervalStr
parameter is not in the correct format or has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
The returned OracleIntervalDS
structure contains the same time interval represented by the supplied intervalStr
. The value specified in the supplied intervalStr
must be in Day HH:MI:SSxFF format.
"1 2:3:4.99"
means 1 day, 2 hours, 3 minutes 4 seconds and 990 milliseconds or 1 day, 2 hours, 3 minutes 4 seconds and 990000000 nanoseconds.
This type conversion operator converts a TimeSpan
structure to an OracleIntervalDS
structure.
// C# public static implicit operator OracleIntervalDS(TimeSpan val);
val
A TimeSpan
instance.
An OracleIntervalDS
structure.
The returned OracleIntervalDS
structure contains the same days, hours, seconds, and milliseconds as the supplied TimeSpan
val
.
The OracleIntervalDS
properties are listed in Table 5-59.
Table 5-59 OracleIntervalDS Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents the Oracle INTERVAL DAY TO SECOND in Oracle internal format |
Days | Gets the days component of an OracleIntervalDS |
Hours | Gets the hours component of an OracleIntervalDS |
IsNull | Indicates whether the current instance has a null value |
Milliseconds | Gets the milliseconds component of an OracleIntervalDS |
Minutes | Gets the minutes component of an OracleIntervalDS |
Nanoseconds | Gets the nanoseconds component of an OracleIntervalDS |
Seconds | Gets the seconds component of an OracleIntervalDS |
TotalDays | Returns the total number, in days, that represent the time period in the OracleIntervalDS structure |
Value | Specifies the time interval that is stored in the OracleIntervalDS structure |
This property returns an array of bytes that represents the Oracle INTERVAL
DAY
TO
SECOND
in Oracle internal format.
// C# public byte[] BinData {get;}
A byte array that represents an Oracle INTERVAL
DAY
TO
SECOND
in Oracle internal format.
OracleNullValueException
- The current instance has a null value.
This property gets the days component of an OracleIntervalDS
.
// C# public int Days {get;}
An int
representing the days component.
OracleNullValueException
- The current instance has a null value.
This property gets the hours component of an OracleIntervalDS.
// C# public int Hours {get;}
An int
representing the hours component.
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull {get;}
Returns true
if the current instance has a null value; otherwise, returns false
.
This property gets the milliseconds component of an OracleIntervalDS.
// C# public double Milliseconds {get;}
A double
that represents milliseconds component.
OracleNullValueException
- The current instance has a null value.
This property gets the minutes component of an OracleIntervalDS.
// C# public int Minutes {get;}
A int
that represents minutes component.
OracleNullValueException
- The current instance has a null value.
This property gets the nanoseconds component of an OracleIntervalDS
.
// C# public int Nanoseconds {get;}
An int
that represents nanoseconds component.
OracleNullValueException
- The current instance has a null value.
This property gets the seconds component of an OracleIntervalDS.
// C# public int Seconds {get;}
An int
that represents seconds component.
OracleNullValueException
- The current instance has a null value.
This property returns the total number, in days, that represent the time period in the OracleIntervalDS
structure.
// C# public double TotalDays {get;}
A double
that represents the total number of days.
OracleNullValueException
- The current instance has a null value.
This property specifies the time interval that is stored in the OracleIntervalDS
structure.
// C# public TimeSpan Value {get;}
A time interval.
OracleNullValueException
- The current instance has a null value.
The OracleIntervalDS
methods are listed in Table 5-60.
Table 5-60 OracleIntervalDS Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleIntervalDS instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether the specified object has the same time interval as the current instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleIntervalDS instance |
GetType | Inherited from Object |
ToString | Converts the current OracleIntervalDS structure to a string |
This method compares the current OracleIntervalDS
instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The object being compared to.
The method returns:
Less than zero: if the current OracleIntervalDS
represents a shorter time interval than obj
.
Zero: if the current OracleIntervalDS
and obj
represent the same time interval.
Greater than zero: if the current OracleIntervalDS
represents a longer time interval than obj
.
IComparable
ArgumentException
- The obj
parameter is not of type OracleIntervalDS
.
The following rules apply to the behavior of this method.
The comparison must be between OracleIntervalDS
s. For example, comparing an OracleIntervalDS
instance with an OracleBinary
instance is not allowed. When an OracleIntervalDS
is compared with a different type, an ArgumentException
is thrown.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
This method determines whether the specified object
has the same time interval as the current instance.
// C# public override bool Equals(object obj);
obj
The specified object.
Returns true
if obj
is of type OracleIntervalDS
and has the same time interval as the current instance; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalDS
that has a value compares greater than an OracleIntervalDS
that has a null value.
Two OracleIntervalDS
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleIntervalDS
instance.
// C# public override int GetHashCode();
Overrides Object
This method converts the current OracleIntervalDS
structure to a string.
// C# public override string ToString();
Returns a string
.
If the current instance has a null value, the returned string contains "null".
The OracleIntervalYM
structure represents the Oracle INTERVAL
YEAR
TO
MONTH
datatype to be stored in or retrieved from a database. Each OracleIntervalYM
stores a period of time in years and months.
Object
ValueType
OracleIntervalYM
// C# public struct OracleIntervalYM : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleIntervalYM OracleIntervalYM iymMax = OracleIntervalYM.MaxValue; double maxYears = iymMax.TotalYears; maxYears -= 1; OracleIntervalYM iymMax_1 = new OracleIntervalYM(maxYears); // Calculate the difference. It should be 1 +/- epsilon years // where epsilon for OracleIntervalYM = 1 month. OracleIntervalYM iymDiff = iymMax - iymMax_1; // If the difference isnt exactly 1 day, display the difference if (iymDiff.TotalYears != 1) Console.WriteLine(iymDiff.ToString());
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleIntervalYM
members are listed in the following tables:
OracleIntervalYM
constructors are listed in Table 5-61
Table 5-61 OracleIntervalYM Constructors
Constructor | Description |
---|---|
OracleIntervalYM Constructors |
Instantiates a new instance of OracleIntervalYM structure (Overloaded) |
The OracleIntervalYM
static fields are listed in Table 5-62.
Table 5-62 OracleIntervalYM Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum value for an OracleIntervalYM structure |
MinValue | Represents the minimum value for an OracleIntervalYM structure |
Null | Represents a null value that can be assigned to an OracleIntervalYM instance |
Zero | Represents a zero value for an OracleIntervalYM structure |
The OracleIntervalYM
static methods are listed in Table 5-63.
Table 5-63 OracleIntervalYM Static Methods
Methods | Description |
---|---|
Equals | Determines whether two OracleIntervalYM values are equal (Overloaded) |
GreaterThan | Determines whether one OracleIntervalYM value is greater than another |
GreaterThanOrEqual | Determines whether one OracleIntervalYM value is greater than or equal to another |
LessThan | Determines whether one OracleIntervalYM value is less than another |
LessThanOrEqual | Determines whether one OracleIntervalYM value is less than or equal to another |
NotEquals | Determines whether two OracleIntervalYM values are not equal |
Parse | Returns an OracleIntervalYM structure and sets its value for time interval using a string |
SetPrecision | Returns a new instance of an OracleIntervalYM with the specified year precision. |
The OracleIntervalYM
static operators are listed in Table 5-64.
Table 5-64 OracleIntervalYM Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalYM values |
operator == | Determines whether two OracleIntervalYM values are equal |
operator > | Determines whether one OracleIntervalYM value is greater than another |
operator >= | Determines whether one OracleIntervalYM value is greater than or equal to another |
operator != | Determines whether two OracleIntervalYM values are not equal |
operator < | Determines whether one OracleIntervalYM value is less than another |
operator <= | Determines whether one OracleIntervalYM value is less than or equal to another |
operator - | Subtracts one OracleIntervalYM value from another |
operator - | Negates an OracleIntervalYM structure |
operator * | Multiplies an OracleIntervalYM value by a number |
operator / | Divides an OracleIntervalYM value by a number |
The OracleIntervalYM
conversions are listed in Table 5-65.
Table 5-65 OracleIntervalYM Type Conversions
Operator | Description |
---|---|
explicit operator long | Converts an OracleIntervalYM structure to a number |
explicit operator OracleIntervalYM | Converts a string to an OracleIntervalYM structure |
implicit operator OracleIntervalYM | Converts the number of months to an OracleIntervalYM structure |
The OracleIntervalYM
properties are listed in Table 5-66.
Table 5-66 OracleIntervalYM Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents the Oracle INTERVAL YEAR TO MONTH in an Oracle internal format |
IsNull | Indicates whether the current instance has a null value |
Months | Gets the months component of an OracleIntervalYM |
TotalYears | Returns the total number, in years, that represents the period of time in the current OracleIntervalYM structure |
Value | Specifies the total number of months that is stored in the OracleIntervalYM structure |
Years | Gets the years component of an OracleIntervalYM |
The OracleIntervalYM
methods are listed in Table 5-67.
Table 5-67 OracleIntervalYM Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleIntervalYM instance to the supplied object, and returns an integer that represents their relative values |
Equals | Determines whether the specified object has the same time interval as the current instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleIntervalYM instance |
GetType | Inherited from Object |
ToString | Converts the current OracleIntervalYM structure to a string |
The OracleIntervalYM
constructors creates a new instance of the OracleIntervalYM
structure.
This method creates a new instance of the OracleIntervalYM
structure using the supplied total number of months for a period of time.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using the supplied string.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using the total number of years.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using years and months.
This method creates a new instance of the OracleIntervalYM
structure and sets its value to the provided byte array, which is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
This method creates a new instance of the OracleIntervalYM
structure using the supplied total number of months for a period of time.
// C# public OracleIntervalYM (long totalMonths);
totalMonths
The number of total months for a time interval. Range is -12,000,000,000 < totalMonths
< 12,000,000,000.
ArgumentOutOfRangeException
- The totalMonths
parameter is out of the specified range.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using the supplied string.
// C# public OracleIntervalYM (string intervalStr);
intervalStr
A string representing the Oracle INTERVAL
YEAR
TO
MONTH
.
The value specified in the supplied intervalStr
must be in Year-Month format.
ArgumentException
- The intervalStr
parameter is not in the valid format or intervalStr
has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
"1-2" means 1 year and 2 months.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using the total number of years.
// C# public OracleIntervalYM (double totalYears);
totalYears
Number of total years. Range is -1,000,000,000 < totalYears
> 1,000,000,000.
ArgumentOutOfRangeException
- The totalYears
parameter is out of the specified range.
ArgumentException
- The totalYears
parameter cannot be used to construct a valid OracleIntervalYM
.
This method creates a new instance of the OracleIntervalYM
structure and sets its value using years and months.
// C# public OracleIntervalYM (int years, int months);
years
Number of years. Range of year is (-999,999,999 to 999,999,999).
months
Number of months. Range of month is (-11 to 11).
The sign of all the arguments must be the same.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleIntervalYM
.
This method creates a new instance of the OracleIntervalYM
structure and sets its value to the provided byte array, which is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
// C# public OracleIntervalYM (byte[] bytes);
bytes
A byte array that is in an internal Oracle INTERVAL
YEAR
TO
MONTH
format.
ArgumentException
- The supplied byte array is not in an internal Oracle INTERVAL
YEAR
TO
MONTH
format or the supplied byte array has an invalid value.
ArgumentNullException
- bytes
is null.
The supplied byte array must be in an internal Oracle INTERVAL
YEAR
TO
MONTH
format.
The OracleIntervalYM
static fields are listed in Table 5-68.
Table 5-68 OracleIntervalYM Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum value for an OracleIntervalYM structure |
MinValue | Represents the minimum value for an OracleIntervalYM structure |
Null | Represents a null value that can be assigned to an OracleIntervalYM instance |
Zero | Represents a zero value for an OracleIntervalYM structure |
This static field represents the maximum value for an OracleIntervalYM
structure.
// C# public static readonly OracleIntervalYM MaxValue;
Year is 999999999 and Month is 11.
This static field represents the minimum value for an OracleIntervalYM
structure.
// C# public static readonly OracleIntervalYM MinValue;
Year is -999999999 and Month is -11.
This static field represents a null value that can be assigned to an OracleIntervalYM
instance.
// C# public static readonly OracleIntervalYM Null;
This static field represents a zero value for an OracleIntervalYM
structure.
// C# public static readonly OracleIntervalDS Zero;
The OracleIntervalYM
static methods are listed in Table 5-69.
Table 5-69 OracleIntervalYM Static Methods
Methods | Description |
---|---|
Equals | Determines whether two OracleIntervalYM values are equal (Overloaded) |
GreaterThan | Determines whether one OracleIntervalYM value is greater than another |
GreaterThanOrEqual | Determines whether one OracleIntervalYM value is greater than or equal to another |
LessThan | Determines whether one OracleIntervalYM value is less than another |
LessThanOrEqual | Determines whether one OracleIntervalYM value is less than or equal to another |
NotEquals | Determines whether two OracleIntervalYM values are not equal |
Parse | Returns an OracleIntervalYM structure and sets its value for time interval using a string |
SetPrecision | Returns a new instance of an OracleIntervalYM with the specified year precision. |
This static method determines whether two OracleIntervalYM
values are equal.
// C# public static bool Equals(OracleIntervalYM val1, OracleIntervalYM val2);
val1
An OracleIntervalYM
structure.
val2
An OracleIntervalYM
structure.
Returns true
if two OracleIntervalYM
values represent the same time interval, otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalYM
values is greater than the second.
// C# public static bool GreaterThan(OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalYM
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is greater than or equal to the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalYM
values is less than the second.
// C# public static bool LessThan(OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method determines whether the first of two OracleIntervalYM
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is less than or equal to the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method determines whether two OracleIntervalYM
values are not equal.
// C# public static bool NotEquals(OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if two OracleIntervalYM
values are not equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static method returns an OracleIntervalYM
structure and sets its value for time interval using a string.
// C# public static OracleIntervalYM Parse (string intervalStr);
intervalStr
A string representing the Oracle INTERVAL
YEAR
TO
MONTH
.
Returns an OracleIntervalYM
structure.
ArgumentException
- The intervalStr
parameter is not in the valid format or intervalStr
has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
The value specified in the supplied intervalStr
must be in the Year-Month format.
"1-2" means 1 year and 2 months.
This static method returns a new instance of an OracleIntervalYM
with the specified year precision.
// C# public static OracleIntervalYM SetPrecision(OracleIntervalYM value1,int yearPrecision);
value1
An OracleIntervalYM
structure.
yearPrecision
The year precision provided. Range of year precision is (0 to 9).
An OracleIntervalDS
instance.
ArgumentOutOfRangeException
- yearPrecision
is out of the specified range.
Depending on the value specified in the supplied yearPrecision
, 0
or more leading zeros are displayed in the string returned by ToString()
.
An OracleIntervalYM
with a value of "1-2
" results in the string "001-2
" when SetPrecision()
is called with the year precision set to 3
.
The OracleIntervalYM
static operators are listed in Table 5-70.
Table 5-70 OracleIntervalYM Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalYM values |
operator == | Determines whether two OracleIntervalYM values are equal |
operator > | Determines whether one OracleIntervalYM value is greater than another |
operator >= | Determines whether one OracleIntervalYM value is greater than or equal to another |
operator != | Determines whether two OracleIntervalYM values are not equal |
operator < | Determines whether one OracleIntervalYM value is less than another |
operator <= | Determines whether one OracleIntervalYM value is less than or equal to another |
operator - | Subtracts one OracleIntervalYM value from another |
operator - | Negates an OracleIntervalYM structure |
operator * | Multiplies an OracleIntervalYM value by a number |
operator / | Divides an OracleIntervalYM value by a number |
This static operator adds two OracleIntervalYM
values.
// C# public static OracleIntervalYM operator + (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
OracleIntervalYM
If either argument has a null value, the returned OracleIntervalYM
structure has a null value.
This static operator determines if two OracleIntervalYM
values are equal.
// C# public static bool operator == (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if they are equal; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalYM
values is greater than the second.
// C# public static bool operator > (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if one OracleIntervalYM
value is greater than another; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalYM
values is greater than or equal to the second.
// C# public static bool operator >= (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if one OracleIntervalYM
value is greater than or equal to another; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator determines whether two OracleIntervalYM
values are not equal.
// C# public static bool operator != (OracleIntervalYM val1, OracleIntervalYM val2)
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if two OracleIntervalYM
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalYM
values is less than the second.
// C# public static bool operator < (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator determines if the first of two OracleIntervalYM
values is less than or equal to the second.
// C# public static bool operator <= (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
Returns true
if the first of two OracleIntervalYM
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
This static operator subtracts one OracleIntervalYM
structure from another.
// C# public static OracleIntervalYM operator - (OracleIntervalYM val1, OracleIntervalYM val2);
val1
First OracleIntervalYM
.
val2
Second OracleIntervalYM
.
An OracleIntervalYM
structure.
If either argument has a null value, the returned OracleIntervalYM
structure has a null value.
This static operator negates an OracleIntervalYM
structure.
// C# public static OracleIntervalYM operator - (OracleIntervalYM val);
val
An OracleIntervalYM
.
An OracleIntervalYM
structure.
If the supplied OracleIntervalYM
structure has a null value, the returned OracleIntervalYM
structure has a null value.
This static operator multiplies an OracleIntervalYM
value by a number.
// C# public static OracleIntervalYM operator * (OracleIntervalYM val1, int multiplier);
val1
First OracleIntervalYM
.
multiplier
A multiplier.
An OracleIntervalYM
structure.
If the supplied OracleIntervalYM
structure has a null value, the returned OracleIntervalYM
structure has a null value.
This static operator divides an OracleIntervalYM
value by a number.
// C# public static OracleIntervalYM operator / (OracleIntervalYM val1, int divisor);
val1
First OracleIntervalYM
.
divisor
A divisor.
An OracleIntervalYM
structure.
If the supplied OracleIntervalYM
structure has a null value, the returned OracleIntervalYM
structure has a null value.
The OracleIntervalYM
conversions are listed in Table 5-71.
Table 5-71 OracleIntervalYM Type Conversions
Operator | Description |
---|---|
explicit operator long | Converts an OracleIntervalYM structure to a number |
explicit operator OracleIntervalYM | Converts a string to an OracleIntervalYM structure |
implicit operator OracleIntervalYM | Converts the number of months to an OracleIntervalYM structure |
This type conversion operator converts an OracleIntervalYM
to a number that represents the number of months in the time interval.
// C# public static explicit operator long (OracleIntervalYM val);
val
An OracleIntervalYM
structure.
A long
number in months.
OracleNullValueException
- The OracleIntervalYM
structure has a null value.
This type conversion operator converts the string intervalStr
to an OracleIntervalYM
structure.
// C# public static explicit operator OracleIntervalYM (string intervalStr);
intervalStr
A string representation of an Oracle INTERVAL
YEAR
TO
MONTH
.
An OracleIntervalYM
structure.
ArgumentException
- The supplied intervalStr
parameter is not in the correct format or has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
The returned OracleIntervalDS
structure contains the same time interval represented by the supplied intervalStr
. The value specified in the supplied intervalStr
must be in Year-Month format.
This type conversion operator converts the total number of months as time interval to an OracleIntervalYM
structure.
// C# public static implicit operator OracleIntervalYM (long months);
months
The number of months to be converted. Range is (-999,999,999 * 12)-11 <= months
<= (999,999,999 * 12)+11.
An OracleIntervalYM
structure.
ArgumentOutOfRangeException
- The months
parameter is out of the specified range.
The OracleIntervalYM
properties are listed in Table 5-72.
Table 5-72 OracleIntervalYM Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents the Oracle INTERVAL YEAR TO MONTH in an Oracle internal format |
IsNull | Indicates whether the current instance has a null value |
Months | Gets the months component of an OracleIntervalYM |
TotalYears | Returns the total number, in years, that represents the period of time in the current OracleIntervalYM structure |
Value | Specifies the total number of months that is stored in the OracleIntervalYM structure |
Years | Gets the years component of an OracleIntervalYM |
This property returns an array of bytes that represents the Oracle INTERVAL
YEAR
TO
MONTH
in Oracle internal format.
// C# public byte[] BinData {get;}
A byte array that represents an Oracle INTERVAL
YEAR
TO
MONTH
in Oracle internal format.
OracleNullValueException
- The current instance has a null value.
This property indicates whether the value has a null value.
// C# public bool IsNull {get;}
Returns true
if value has a null value; otherwise, returns false
.
This property gets the months component of an OracleIntervalYM.
// C# public int Months {get;}
An int
representing the months component.
OracleNullValueException
- The current instance has a null value.
This property returns the total number, in years, that represents the period of time in the current OracleIntervalYM
structure.
// C# public double TotalYears {get;}
A double
representing the total number of years.
OracleNullValueException
- The current instance has a null value.
This property gets the total number of months that is stored in the OracleIntervalYM
structure.
// C# public long Value {get;}
The total number of months representing the time interval.
OracleNullValueException
- The current instance has a null value.
This property gets the years component of an OracleIntervalYM
.
// C# public int Years {get;}
An int
representing the years component.
OracleNullValueException
- The current instance has a null value.
The OracleIntervalYM
methods are listed in Table 5-73.
Table 5-73 OracleIntervalYM Methods
Methods | Description |
---|---|
CompareTo | Compares the current OracleIntervalYM instance to the supplied object, and returns an integer that represents their relative values |
Equals | Determines whether the specified object has the same time interval as the current instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleIntervalYM instance |
GetType | Inherited from Object |
ToString | Converts the current OracleIntervalYM structure to a string |
This method compares the current OracleIntervalYM
instance to the supplied object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The supplied object.
The method returns a number:
Less than zero: if the current OracleIntervalYM
represents a shorter time interval than obj.
Zero: if the current OracleIntervalYM
and obj
represent the same time interval.
Greater than zero: if the current OracleIntervalYM
represents a longer time interval than obj.
IComparable
ArgumentException
- The obj
parameter is not of type OracleIntervalYM
.
The following rules apply to the behavior of this method.
The comparison must be between OracleIntervalYM
s. For example, comparing an OracleIntervalYM
instance with an OracleBinary
instance is not allowed. When an OracleIntervalYM
is compared with a different type, an ArgumentException
is thrown.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
Overrides Object
This method determines whether the specified object has the same time interval as the current instance.
// C# public override bool Equals(object obj);
obj
The supplied object.
Returns true
if the specified object instance is of type OracleIntervalYM
and has the same time interval; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleIntervalYM
that has a value compares greater than an OracleIntervalYM
that has a null value.
Two OracleIntervalYM
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleIntervalYM
instance.
// C# public override int GetHashCode();
An int
representing a hash code.
Overrides Object
This method converts the current OracleIntervalYM
structure to a string.
// C# public override string ToString();
A string that represents the current OracleIntervalYM
structure.
If the current instance has a null value, the returned string contain "null".
The OracleString
structure represents a variable-length stream of characters to be stored in or retrieved from a database.
Object
ValueType
OracleString
// C# public struct OracleString : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates the usage of OracleString // bytes1 is non-Unicode encoded byte array = AAAAA // bytes2 is Unicode encoded byte array = aa byte[] bytes1 = new byte[] {65,65,65,65,65}; byte[] bytes2 = new byte[] {97,0,97,0}; // set str1 = AAA // set str2 = a OracleString str1 = new OracleString(bytes1, 0, 3, false, true); OracleString str2 = new OracleString(bytes2, 2, 2, true, true); // Display the constructed strings Console.WriteLine("String str1 = " + str1.Value + ". Length = " + str1.Length); // Prints String str1 = AAA. Length = 3 Console.WriteLine("String str2 = " + str2.Value + ". Length = " + str2.Length); // Prints String str2 = a. Length = 1 while (str1 > str2) str2 = OracleString.Concat(str2,"a"); // Display the constructed strings Console.WriteLine("String str1 = " + str1.Value + ". Length = " + str1.Length); // Prints String str1 = AAA. Length= 3 Console.WriteLine("String str2 = " + str2.Value + ". Length = " + str2.Length); // Prints String str2 = aaa. Length= 3
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleString
members are listed in the following tables:
OracleString
constructors are listed in Table 5-74
Table 5-74 OracleString Constructors
Constructor | Description |
---|---|
OracleString Constructors | Instantiates a new instance of OracleString structure (Overloaded) |
The OracleString
static fields are listed in Table 5-75.
Table 5-75 OracleString Static Fields
Field | Description |
---|---|
Null | Represents a null value that can be assigned to an instance of the OracleString structure |
The OracleString
static methods are listed in Table 5-76.
Table 5-76 OracleString Static Methods
Methods | Description |
---|---|
Concat | Concatenates two OracleString instances and returns a new OracleString instance that represents the result |
Equals | Determines if two OracleString values are equal (Overloaded) |
GreaterThan | Determines whether the first of two OracleString values is greater than the second |
GreaterThanOrEqual | Determines whether the first of two OracleString values is greater than or equal to the second |
LessThan | Determines whether the first of two OracleString values is less than the second |
LessThanOrEqual | Determines whether the first of two OracleString values is less than or equal to the second |
NotEquals | Determines whether two OracleString values are not equal |
The OracleString
static operators are listed in Table 5-77.
Table 5-77 OracleString Static Operators
Operator | Description |
---|---|
operator + | Concatenates two OracleString values |
operator == | Determines if two OracleString values are equal |
operator > | Determines if the first of two OracleString values is greater than the second |
operator >= | Determines if the first of two OracleString values is greater than or equal to the second |
operator != | Determines if the two OracleString values are not equal |
operator < | Determines if the first of two OracleString values is less than the second |
operator <= | Determines if two OracleString values are not equal |
The OracleString
type conversions are listed in Table 5-78.
Table 5-78 OracleString Type Conversions
Operator | Description |
---|---|
explicit operator string | Converts the supplied OracleString to a string instance |
implicit operator OracleString | Converts the supplied string to an OracleString instance |
The OracleString
properties are listed in Table 5-79.
Table 5-79 OracleString Properties
Properties | Description |
---|---|
IsCaseIgnored | Indicates whether case should be ignored when performing string comparison |
IsNull | Indicates whether the current instance has a null value |
Item | Obtains the particular character in an OracleString using an index. |
Length | Returns the length of the OracleString |
The OracleString
methods are listed in Table 5-80.
Table 5-80 OracleString Methods
Methods | Description |
---|---|
Clone | Returns a copy of the current OracleString instance |
CompareTo | Compares the current OracleString instance to the supplied object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same string value as the current OracleString structure (Overloaded) |
GetHashCode | Returns a hash code for the OracleString instance |
GetNonUnicodeBytes | Returns an array of bytes, containing the contents of the OracleString , in the client character set format |
GetType | Inherited from Object |
GetUnicodeBytes | Returns an array of bytes, containing the contents of the OracleString , in Unicode format |
ToString | Converts the current OracleString instance to a string |
The OracleString
constructors create new instances of the OracleString
structure.
This constructor creates a new instance of the OracleString
structure and sets its value using a string.
This constructor creates a new instance of the OracleString
structure and sets its value using a string and specifies if case is ignored in comparison.
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array and specifies if the supplied byte array is Unicode encoded.
OracleString(byte [ ], bool, bool)
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array and specifies the following: if the supplied byte array is Unicode encoded and if case is ignored in comparison.
OracleString(byte [ ], int, int, bool)
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array, and specifies the following: the starting index in the byte array, the number of bytes to copy from the byte array, and if the supplied byte array is Unicode encoded.
OracleString(byte [ ], int, int, bool, bool)
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array, and specifies the following: the starting index in the byte array, the number of bytes to copy from the byte array, if the supplied byte array is Unicode encoded, and if case is ignored in comparison.
This constructor creates a new instance of the OracleString
structure and sets its value using a string.
// C# public OracleString(string data);
data
A string value.
This constructor creates a new instance of the OracleString
structure and sets its value using a string and specifies if case is ignored in comparison.
// C# public OracleString(string data, bool isCaseIgnored);
data
A string value.
isCaseIgnored
Specifies if case is ignored in comparison. Specifies true
if case is to be ignored; otherwise, specifies false
.
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array and specifies if the supplied byte array is Unicode encoded.
// C# public OracleString(byte[] data, bool fUnicode);
data
Byte array data for the new OracleString
.
fUnicode
Specifies if the supplied data
is Unicode encoded. Specifies true
if Unicode encoded; otherwise, false
.
ArgumentNullException
- The data
parameter is null.
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array and specifies the following: if the supplied byte array is Unicode encoded and if case is ignored in comparison.
// C# public OracleString(byte[] data, bool fUnicode, bool isCaseIgnored);
data
Byte array data for the new OracleString
.
fUnicode
Specifies if the supplied data
is Unicode encoded. Specifies true
if Unicode encoded; otherwise, false
.
isCaseIgnored
Specifies if case is ignored in comparison. Specifies true
if case is to be ignored; otherwise, specifies false
.
ArgumentNullException
- The data
parameter is null.
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array, and specifies the following: the starting index in the byte array, the number of bytes to copy from the byte array, and if the supplied byte array is Unicode encoded.
// C# public OracleString(byte[] data, int index, int count, bool fUnicode);
data
Byte array data for the new OracleString
.
index
The starting index to copy from data
.
count
The number of bytes to copy.
fUnicode
Specifies if the supplied data
is Unicode encoded. Specifies true
if Unicode encoded; otherwise, false
.
ArgumentNullException
- The data
parameter is null.
ArgumentOutOfRangeException
- The count
parameter is less than zero.
IndexOutOfRangeException
- The index
parameter is greater than or equal to the length of data
or less than zero.
This constructor creates a new instance of the OracleString
structure and sets its value using a byte array, and specifies the following: the starting index in the byte array, the number of bytes to copy from the byte array, if the supplied byte array is Unicode encoded, and if case is ignored in comparison.
// C# public OracleString(byte[] data, int index, int count, bool fUnicode, bool isCaseIgnored);
data
Byte array data for the new OracleString
.
index
The starting index to copy from data
.
count
The number of bytes to copy.
fUnicode
Specifies if the supplied data
is Unicode encoded. Specifies true
if Unicode encoded; otherwise, false
.
isCaseIgnored
Specifies if case is ignored in comparison. Specifies true
if case is to be ignored; otherwise, specifies false
.
ArgumentNullException
- The data
parameter is null.
ArgumentOutOfRangeException
- The count
parameter is less than zero.
IndexOutOfRangeException
- The index
parameter is greater than or equal to the length of data
or less than zero.
The OracleString
static fields are listed in Table 5-81.
Table 5-81 OracleString Static Fields
Field | Description |
---|---|
Null | Represents a null value that can be assigned to an instance of the OracleString structure |
This static field represents a null value that can be assigned to an instance of the OracleString
structure.
// C# public static readonly OracleString Null;
The OracleString
static methods are listed in Table 5-82.
Table 5-82 OracleString Static Methods
Methods | Description |
---|---|
Concat | Concatenates two OracleString instances and returns a new OracleString instance that represents the result |
Equals | Determines if two OracleString values are equal (Overloaded) |
GreaterThan | Determines whether the first of two OracleString values is greater than the second |
GreaterThanOrEqual | Determines whether the first of two OracleString values is greater than or equal to the second |
LessThan | Determines whether the first of two OracleString values is less than the second |
LessThanOrEqual | Determines whether the first of two OracleString values is less than or equal to the second |
NotEquals | Determines whether two OracleString values are not equal |
This static method concatenates two OracleString
instances and returns a new OracleString
instance that represents the result.
// C# public static OracleString Concat(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString
.
An OracleString.
If either argument has a null value, the returned OracleString
structure has a null value.
Overloads Object
This static method determines whether the two OracleString
s being compared are equal.
// C# public static bool Equals(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString.
Returns true
if the two OracleString
s being compared are equal; returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static method determines whether the first of two OracleString
values is greater than the second.
// C# public static bool GreaterThan(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString.
Returns true
if the first of two OracleString
s is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static method determines whether the first of two OracleString
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleString str1, OracleString str2);
str1
First OracleString
.
str2
Second OracleString
.
Returns true
if the first of two OracleString
s is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static method determines whether the first of two OracleString
values is less than the second.
// C# public static bool LessThan(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString.
Returns true
if the first is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static method determines whether the first of two OracleString
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString.
Returns true
if the first is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static method determines whether two OracleString
values are not equal.
// C# public static bool NotEquals(OracleString str1, OracleString str2);
str1
First OracleString.
str2
Second OracleString.
Returns true
if the two OracleString
instances are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
The OracleString
static operators are listed in Table 5-83.
Table 5-83 OracleString Static Operators
Operator | Description |
---|---|
operator + | Concatenates two OracleString values |
operator == | Determines if two OracleString values are equal |
operator > | Determines if the first of two OracleString values is greater than the second |
operator >= | Determines if the first of two OracleString values is greater than or equal to the second |
operator != | Determines if the two OracleString values are not equal |
operator < | Determines if the first of two OracleString values is less than the second |
operator <= | Determines if two OracleString values are not equal |
This static operator concatenates two OracleString
values.
// C# public static OracleString operator + (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
An OracleString.
If either argument has a null value, the returned OracleString
structure has a null value.
This static operator determines if two OracleString
values are equal.
// C# public static bool operator == (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if two OracleString
values are equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static operator determines if the first of two OracleString
values is greater than the second.
// C# public static bool operator > (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if the first of two OracleString
values is greater than the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static operator determines if the first of two OracleString
values is greater than or equal to the second.
// C# public static bool operator >= (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if the first of two OracleString
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static operator determines if two OracleString
values are not equal.
// C# public static bool operator != (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if two OracleString
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This static operator determines if the first of two OracleString
s is less than the second.
// C# public static bool operator < (OracleString value1, OracleString value2);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if the first of two OracleString
s is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
has a null value.
Two OracleString
s that contain a null value are equal.
This static operator determines if the first of two OracleString
values is less than or equal to the second.
// C# public static bool operator <= (OracleString value1, OracleString value1);
value1
First OracleString
.
value2
Second OracleString
.
Returns true
if the first of two OracleString
values is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
The OracleString
type conversions are listed in Table 5-84.
Table 5-84 OracleString Type Conversions
Operator | Description |
---|---|
explicit operator string | Converts the supplied OracleString to a string instance |
implicit operator OracleString | Converts the supplied string to an OracleString instance |
This type conversion operator converts the supplied OracleString
to a string
.
//C# public static explicit operator string (OracleString value1);
value1
The supplied OracleString
.
string
OracleNullValueException
- The OracleString
structure has a null value.
This type conversion operator converts the supplied string
to an OracleString
.
// C# public static implicit operator OracleString (string value1);
value1
The supplied string.
An OracleString.
The OracleString
properties are listed in Table 5-85.
Table 5-85 OracleString Properties
Properties | Description |
---|---|
IsCaseIgnored | Indicates whether case should be ignored when performing string comparison |
IsNull | Indicates whether the current instance has a null value |
Item | Obtains the particular character in an OracleString using an index. |
Length | Returns the length of the OracleString |
This property indicates whether case should be ignored when performing string comparison.
//C# public bool IsCaseIgnored {get;set;}
Returns true
if string comparison must ignore case; otherwise false
.
Default value is true
.
// C# OracleString str1 = new OracleString("aAaAa"); OracleString str2 = new OracleString("AaAaA"); str1.IsCaseIgnored = true; str2.IsCaseIgnored = true; Console.WriteLine(str1.CompareTo(str2)); // Prints 0 // Note that IsCaseIgnored must be set to false for both OracleStrings // otherwise an exception is thrown str1.IsCaseIgnored = false; str2.IsCaseIgnored = false; Console.WriteLine(str1.CompareTo(str2)); // Prints non zero value
This property indicates whether the current instance contains a null value.
// C# public bool IsNull {get;}
Returns true
if the current instance contains has a null value; otherwise, returns false
.
This property obtains the particular character in an OracleString
using an index.
// C# public char Item {get;}
A char
value.
OracleNullValueException
- The current instance has a null value.
This property returns the length of the OracleString
.
// C# public int Length {get;}
A int
value.
OracleNullValueException
- The current instance has a null value.
The OracleString
methods are listed in Table 5-86.
Table 5-86 OracleString Methods
Methods | Description |
---|---|
Clone | Returns a copy of the current OracleString instance |
CompareTo | Compares the current OracleString instance to the supplied object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same string value as the current OracleString structure (Overloaded) |
GetHashCode | Returns a hash code for the OracleString instance |
GetNonUnicodeBytes | Returns an array of bytes, containing the contents of the OracleString , in the client character set format |
GetType | Inherited from Object |
GetUnicodeBytes | Returns an array of bytes, containing the contents of the OracleString , in Unicode format |
ToString | Converts the current OracleString instance to a string |
This method creates a copy of an OracleString
instance.
// C# public OracleString Clone();
An OracleString
structure.
The cloned object has the same property values as that of the object being cloned.
// C# ... OracleString str_cloned = str.Clone(); ...
This method compares the current OracleString
instance to the supplied object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The object being compared to the current instance.
The method returns a number that is:
Less than zero: if the current OracleString
value is less than obj
.
Zero: if the current OracleString
value is equal to obj
.
Greater than zero: if the current OracleString
value is greater than obj
.
IComparable
ArgumentException
- The obj
parameter is not of type OracleString
.
The following rules apply to the behavior of this method.
The comparison must be between OracleString
s. For example, comparing an OracleString
instance with an OracleBinary
instance is not allowed. When an OracleString
is compared with a different type, an ArgumentException
is thrown.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
This method determines whether supplied object is an instance of OracleString
and has the same values as the current OracleString
instance.
// C# public override bool Equals(object obj);
obj
An object being compared.
Returns true
if the supplied object is an instance of OracleString
and has the same values as the current OracleString
instance; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleString
that has a value is greater than an OracleString
that has a null value.
Two OracleString
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleString
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method returns an array of bytes, containing the contents of the OracleString
, in the client character set format.
// C# public byte[] GetNonUnicodeBytes();
A byte array that contains the contents of the OracleString
in the client character set format.
If the current instance has a null value, an OracleNullValueException
is thrown.
This method returns an array of bytes, containing the contents of the OracleString
in Unicode format.
// C# public byte[] GetUnicodeBytes();
A byte array that contains the contents of the OracleString
in Unicode format.
If the current instance has a null value, an OracleNullValueException
is thrown.
Overrides Object
This method converts the current OracleString
instance to a string
.
// C# public override string ToString();
A string.
If the current OracleString
instance has a null value, the string contains "null"
.
The OracleTimeStamp
structure represents the Oracle TIMESTAMP
datatype to be stored in or retrieved from a database. Each OracleTimeStamp
stores the following information: year, month, day, hour, minute, second, and nanosecond.
Object
ValueType
OracleTimeStamp
// C# public struct OracleTimeStamp : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleTimeStamp OracleTimeStamp tsCurrent1 = OracleTimeStamp.GetSysDate(); OracleTimeStamp tsCurrent2 = DateTime.Now; // Calculate the difference between tsCurrent1 and tsCurrent2 OracleIntervalDS idsDiff = tsCurrent2.GetDaysBetween(tsCurrent1); // Calculate the difference using AddNanoseconds() int nanoDiff = 0; while (tsCurrent2 > tsCurrent1) { nanoDiff += 10; tsCurrent1 = tsCurrent1.AddNanoseconds(10); } Console.WriteLine("idsDiff.Nanoseconds = " + idsDiff.Nanoseconds); Console.WriteLine("nanoDiff = " + nanoDiff);
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleTimeStamp
members are listed in the following tables:
OracleTimeStamp
constructors are listed in Table 5-87
Table 5-87 OracleTimeStamp Constructors
Constructor | Description |
---|---|
OracleTimeStamp Constructors | Instantiates a new instance of OracleTimeStamp structure (Overloaded) |
The OracleTimeStamp
static fields are listed in Table 5-88.
Table 5-88 OracleTimeStamp Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid date for an OracleTimeStamp structure, which is December 31, 9999 23:59:59.999999999 |
MinValue | Represents the minimum valid date for an OracleTimeStamp structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStamp structure |
The OracleTimeStamp
static methods are listed in Table 5-89.
Table 5-89 OracleTimeStamp Static Methods
Methods | Description |
---|---|
Equals | Determines if two OracleTimeStamp values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleTimeStamp values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleTimeStamp values is greater than or equal to the second |
LessThan | Determines if the first of two OracleTimeStamp values is less than the second |
LessThanOrEqual | Determines if the first of two OracleTimeStamp values is less than or equal to the second |
NotEquals | Determines if two OracleTimeStamp values are not equal |
GetSysDate | Gets an OracleTimeStamp structure that represents the current date and time |
Parse | Gets an OracleTimeStamp structure and sets its value using the supplied string |
SetPrecision | Returns a new instance of an OracleTimeStamp with the specified fractional second precision |
The OracleTimeStamp
static operators are listed in Table 5-90.
Table 5-90 OracleTimeStamp Static Operators
Operator | Description |
---|---|
operator + | Adds the supplied instance value to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure (Overloaded) |
operator == | Determines if two OracleTimeStamp values are equal |
operator > | Determines if the first of two OracleTimeStamp values is greater than the second |
operator >= | Determines if the first of two OracleTimeStamp values is greater than or equal to the second |
operator != | Determines if the two OracleTimeStamp values are not equal |
operator < | Determines if the first of two OracleTimeStamp values is less than the second |
operator <= | Determines if the first of two OracleTimeStamp values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStamp and returns a new OracleTimeStamp structure (Overloaded) |
The OracleTimeStamp
static type conversions are listed in Table 5-91.
Table 5-91 OracleTimeStamp Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStamp | Converts an instance value to an OracleTimeStamp structure (Overloaded) |
implicit operator OracleTimeStamp | Converts an instance value to an OracleTimeStamp structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStamp value to a DateTime structure |
The OracleTimeStamp
properties are listed in Table 5-92.
Table 5-92 OracleTimeStamp Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents an Oracle TIMESTAMP in Oracle internal format |
Day | Specifies the day component of an OracleTimeStamp |
IsNull | Indicates whether the OracleTimeStamp instance has a null value |
Hour | Specifies the hour component of an OracleTimeStamp |
Millisecond | Specifies the millisecond component of an OracleTimeStamp |
Minute | Specifies the minute component of an OracleTimeStamp |
Month | Specifies the month component of an OracleTimeStamp |
Nanosecond | Specifies the nanosecond component of an OracleTimeStamp |
Second | Specifies the second component of an OracleTimeStamp |
Value | Specifies the date and time that is stored in the OracleTimeStamp structure |
Year | Specifies the year component of an OracleTimeStamp |
The OracleTimeStamp
methods are listed in Table 5-93.
Table 5-93 OracleTimeStamp Methods
Methods | Description |
---|---|
AddDays | Adds the supplied number of days to the current instance |
AddHours | Adds the supplied number of hours to the current instance |
AddMilliseconds | Adds the supplied number of milliseconds to the current instance |
AddMinutes | Adds the supplied number of minutes to the current instance |
AddMonths | Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears | Adds the supplied number of years to the current instance |
CompareTo | Compares the current OracleTimeStamp instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same date and time as the current OracleTimeStamp instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleTimeStamp instance |
GetDaysBetween | Subtracts an OracleTimeStamp value from the current instance and returns an OracleIntervalDS that represents the time difference between the supplied OracleTimeStamp and the current instance |
GetYearsBetween | Subtracts value1 from the current instance and returns an OracleIntervalYM that represents the difference between value1 and the current instance using OracleIntervalYM |
GetType | Inherited from Object |
ToOracleDate | Converts the current OracleTimeStamp structure to an OracleDate structure |
ToOracleTimeStampLTZ | Converts the current OracleTimeStamp structure to an OracleTimeStampLTZ structure |
ToOracleTimeStampTZ | Converts the current OracleTimeStamp structure to an OracleTimeStampTZ structure |
ToString | Converts the current OracleTimeStamp structure to a string |
The OracleTimeStamp
constructors create new instances of the OracleTimeStamp
structure.
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using the supplied DateTime
value.
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value using the supplied string.
OracleTimeStamp(int, int, int)
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date using year, month, and day.
OracleTimeStamp(int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, and second.
OracleTimeStamp(int, int, int, int, int, int, double)
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
OracleTimeStamp(int, int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP
format.
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using the supplied DateTime
value.
// C# public OracleTimeStamp (DateTime dt);
dt
The supplied DateTime
value.
ArgumentException
- The dt
parameter cannot be used to construct a valid OracleTimeStamp
.
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value using the supplied string.
// C# public OracleTimeStamp (string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP
.
ArgumentException
- The tsStr
value is an invalid string representation of an Oracle TIMESTAMP
or the supplied tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStamp(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date using year, month, and day.
// C# public OracleTimeStamp(int year, int month, int day);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStamp
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C# public OracleTimeStamp (int year, int month, int day, int hour, int minute, int second);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStamp
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C# public OracleTimeStamp(int year, int month, int day, int hour, int minute, int second, double millisecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
milliSeconds
The milliseconds provided. Range of millisecond
is (0 to 999.999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStamp
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C# public OracleTimeStamp (int year, int month, int day, int hour, int minute, int second, int nanosecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
nanosecond
The nanosecond provided. Range of nanosecond
is (0 to 999999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStamp
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStamp
structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP
format.
// C# public OracleTimeStamp (byte[] bytes);
bytes
A byte array that represents an Oracle TIMESTAMP
in Oracle internal format.
ArgumentException
- bytes
is not in an internal Oracle TIMESTAMP
format or bytes
is not a valid Oracle TIMESTAMP
.
ArgumentNullException
- bytes
is null.
The OracleTimeStamp
static fields are listed in Table 5-94.
Table 5-94 OracleTimeStamp Static Fields
Field | Description |
---|---|
MaxValue | Represents the maximum valid date for an OracleTimeStamp structure, which is December 31, 9999 23:59:59.999999999 |
MinValue | Represents the minimum valid date for an OracleTimeStamp structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStamp structure |
This static field represents the maximum valid date and time for an OracleTimeStamp
structure, which is December 31, 9999 23:59:59.999999999.
// C# public static readonly OraTimestamp MaxValue;
This static field represents the minimum valid date and time for an OracleTimeStamp
structure, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStamp MinValue;
This static field represents a null value that can be assigned to an instance of the OracleTimeStamp
structure.
// C# public static readonly OracleTimeStamp Null;
The OracleTimeStamp
static methods are listed in Table 5-95.
Table 5-95 OracleTimeStamp Static Methods
Methods | Description |
---|---|
Equals | Determines if two OracleTimeStamp values are equal (Overloaded) |
GreaterThan | Determines if the first of two OracleTimeStamp values is greater than the second |
GreaterThanOrEqual | Determines if the first of two OracleTimeStamp values is greater than or equal to the second |
LessThan | Determines if the first of two OracleTimeStamp values is less than the second |
LessThanOrEqual | Determines if the first of two OracleTimeStamp values is less than or equal to the second |
NotEquals | Determines if two OracleTimeStamp values are not equal |
GetSysDate | Gets an OracleTimeStamp structure that represents the current date and time |
Parse | Gets an OracleTimeStamp structure and sets its value using the supplied string |
SetPrecision | Returns a new instance of an OracleTimeStamp with the specified fractional second precision |
This static method determines if two OracleTimeStamp
values are equal.
// C# public static bool Equals(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if two OracleTimeStamp
values are equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp
values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first of two OracleTimeStamp
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first of two OracleTimeStamp
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp
values is less than the second.
// C# public static bool LessThan(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first of two OracleTimeStamp
values is less than the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStamp
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first of two OracleTimeStamp
values is less than or equal to the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method determines if two OracleTimeStamp
values are not equal.
// C# public static bool NotEquals(OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if two OracleTimeStamp
values are not equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static method gets an OracleTimeStamp
structure that represents the current date and time.
// C# public static OracleTimeStamp GetSysDate();
An OracleTimeStamp
structure that represents the current date and time.
This static method gets an OracleTimeStamp
structure and sets its value using the supplied string.
// C# public static OracleTimeStamp Parse(string datetime);
datetime
A string that represents an Oracle TIMESTAMP
.
An OracleTimeStamp
structure.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
or the supplied tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = OracleTimeStamp.Parse("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This static method returns a new instance of an OracleTimeStamp
with the specified fractional second precision.
// C# public static OracleTimeStamp SetPrecision(OracleTimeStamp value1, int fracSecPrecision);
value1
The provided OracleTimeStamp
object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStamp
structure with the specified fractional second precision.
ArgumentOutOfRangeException
- fracSecPrecision
is out of the specified range.
The value specified in the supplied fracSecPrecision
is used to perform a rounding off operation on the supplied OracleTimeStamp
value. Depending on this value, 0
or more trailing zeros are displayed in the string returned by ToString()
.
The OracleTimeStamp
with a value of "December
31,
9999
23:59:59.99
" results in the string "December
31,
9999
23:59:59.99000
" when SetPrecision()
is called with the fractional second precision set to 5
.
The OracleTimeStamp
static operators are listed in Table 5-96.
Table 5-96 OracleTimeStamp Static Operators
Operator | Description |
---|---|
operator + | Adds the supplied instance value to the supplied OracleTimeStamp and returns a new OracleTimeStamp structure (Overloaded) |
operator == | Determines if two OracleTimeStamp values are equal |
operator > | Determines if the first of two OracleTimeStamp values is greater than the second |
operator >= | Determines if the first of two OracleTimeStamp values is greater than or equal to the second |
operator != | Determines if the two OracleTimeStamp values are not equal |
operator < | Determines if the first of two OracleTimeStamp values is less than the second |
operator <= | Determines if the first of two OracleTimeStamp values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStamp and returns a new OracleTimeStamp structure (Overloaded) |
operator +
operator+
adds the supplied object to the OracleTimeStamp
and returns a new OracleTimeStamp
structure.
operator + (OracleTimeStamp, OracleIntervalDS)
This static operator adds the supplied OracleIntervalDS
to the OracleTimeStamp
and returns a new OracleTimeStamp
structure.
operator + (OracleTimeStamp, OracleIntervalYM)
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStamp
and returns a new OracleTimeStamp
structure.
operator + (OracleTimeStamp, TimeSpan)
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStamp
and returns a new OracleTimeStamp
structure.
This static operator adds the supplied OracleIntervalDS
to the OracleTimeStamp
and returns a new OracleTimeStamp
structure.
// C# public static operator + (OracleTimeStamp value1, OracleIntervalDS value2);
value1
An OracleTimeStamp
.
value2
An OracleIntervalDS
.
An OracleTimeStamp.
If either parameter has a null value, the returned OracleTimeStamp
has a null value.
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStamp
and returns a new OracleTimeStamp
structure.
// C# public static operator + (OracleTimeStamp value1, OracleIntervalYM value2);
value1
An OracleTimeStamp
.
value2
An OracleIntervalYM.
An OracleTimeStamp
.
If either parameter has a null value, the returned OracleTimeStamp
has a null value.
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStamp
and returns a new OracleTimeStamp
structure.
// C# public static operator + (OracleTimeStamp value1, TimeSpan value2);
value1
An OracleTimeStamp
.
value2
A TimeSpan.
An OracleTimeStamp.
If the OracleTimeStamp
instance has a null value, the returned OracleTimeStamp
has a null value.
This static operator determines if two OracleTimeStamp
values are equal.
// C# public static bool operator == (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if they are the same; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp
values is greater than the second.
// C# public static bool operator > (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first OracleTimeStamp
value is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp
values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first OracleTimeStamp
is greater than or equal to the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static operator determines if two OracleTimeStamp
values are not equal.
// C# public static bool operator != (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if two OracleTimeStamp
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp
values is less than the second.
// C# public static bool operator < (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp
.
value2
Second OracleTimeStamp
.
Returns true
if the first OracleTimeStamp
is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStamp
values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStamp value1, OracleTimeStamp value2);
value1
First OracleTimeStamp.
value2
Second OracleTimeStamp.
Returns true
if the first OracleTimeStamp
is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
operator -
operator-
subtracts the supplied value, from the supplied OracleTimeStamp
value, and returns a new OracleTimeStamp
structure.
operator - (OracleTimeStamp, OracleIntervalDS)
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStamp
value, and return a new OracleTimeStamp
structure.
operator - (OracleTimeStamp, OracleIntervalYM)
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStamp
value, and returns a new OracleTimeStamp
structure.
operator - (OracleTimeStamp, TimeSpan)
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStamp
value, and returns a new OracleTimeStamp
structure.
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStamp
value, and return a new OracleTimeStamp
structure.
// C# public static operator - (OracleTimeStamp value1, OracleIntervalDS value2);
value1
An OracleTimeStamp
.
value2
An OracleIntervalDS
instance.
An OracleTimeStamp
structure.
If either parameter has a null value, the returned OracleTimeStamp
has a null value.
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStamp
value, and returns a new OracleTimeStamp
structure.
// C# public static operator - (OracleTimeStamp value1, OracleIntervalYM value2);
value1
An OracleTimeStamp
.
value2
An OracleIntervalYM
instance.
An OracleTimeStamp
structure.
If either parameter has a null value, the returned OracleTimeStamp
has a null value.
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStamp
value, and returns a new OracleTimeStamp
structure.
// C# public static operator - (OracleTimeStamp value1, TimeSpan value2);
value1
An OracleTimeStamp
.
value2
A TimeSpan
instance.
An OracleTimeStamp
structure.
If the OracleTimeStamp
instance has a null value, the returned OracleTimeStamp
structure has a null value.
The OracleTimeStamp
static type conversions are listed in Table 5-97.
Table 5-97 OracleTimeStamp Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStamp | Converts an instance value to an OracleTimeStamp structure (Overloaded) |
implicit operator OracleTimeStamp | Converts an instance value to an OracleTimeStamp structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStamp value to a DateTime structure |
explicit operator OracleTimeStamp
explicit operator OracleTimeStamp
converts the supplied value to an OracleTimeStamp
structure
explicit operator OracleTimeStamp(OracleTimeStampLTZ)
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStamp
structure.
explicit operator OracleTimeStamp(OracleTimeStampTZ)
This static type conversion operator converts an OracleTimeStampTZ
value to an OracleTimeStamp
structure.
explicit operator OracleTimeStamp(string)
This static type conversion operator converts the supplied string to an OracleTimeStamp
structure.
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStamp
structure.
// C# public static explicit operator OracleTimeStamp(OracleTimeStampLTZ value1);
value1
An OracleTimeStampLTZ
instance.
The returned OracleTimeStamp
contains the date and time of the OracleTimeStampLTZ
structure.
If the OracleTimeStampLTZ
structure has a null value, the returned OracleTimeStamp
structure also has a null value.
This static type conversion operator converts an OracleTimeStampTZ
value to an OracleTimeStamp
structure.
// C# public static explicit operator OracleTimeStamp(OracleTimeStampTZ value1);
value1
An OracleTimeStampTZ
instance.
The returned OracleTimeStamp
contains the date and time information from value1
, but the time zone information from value1
is truncated.
If the OracleTimeStampTZ
structure has a null value, the returned OracleTimeStamp
structure also has a null value.
This static type conversion operator converts the supplied string to an OracleTimeStamp
structure.
// C# public static explicit operator OracleTimeStamp(string tsStr);
tsStr
A string representation of an Oracle TIMESTAMP
.
A OracleTimeStamp
.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
or the tsStr
is not in the timestamp format specified by the thread's OracleGlobalization
.TimeStampFormat
property, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the explicit operator // OracleTimeStamp(string) OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
implicit operator OracleTimeStamp
This static type conversion operator converts a value to an OracleTimeStamp
structure.
implicit operator OracleTimeStamp(OracleDate)
This static type conversion operator converts an OracleDate
value to an OracleTimeStamp
structure.
implicit operator OracleTimeStamp(DateTime)
This static type conversion operator converts a DateTime
value to an OracleTimeStamp
structure.
This static type conversion operator converts an OracleDate
value to an OracleTimeStamp
structure.
// C# public static implicit operator OracleTimeStamp (OracleDate value1);
value1
An OracleDate
instance.
An OracleTimeStamp
structure that contains the date and time of the OracleDate
structure, value1
.
If the OracleDate
structure has a null value, the returned OracleTimeStamp
structure also has a null value.
This static type conversion operator converts a DateTime
value to an OracleTimeStamp
structure.
// C# public static implicit operator OracleTimeStamp(DateTime value);
value
A DateTime
instance.
An OracleTimeStamp
structure.
This static type conversion operator converts an OracleTimeStamp
value to a DateTime
structure.
// C# public static explicit operator DateTime(OracleTimeStamp value1);
value1
An OracleTimeStamp
instance.
A DateTime
containing the date and time in the current instance.
OracleNullValueException
- The OracleTimeStamp
structure has a null value.
The precision of the OracleTimeStamp
can be lost during the conversion.
The OracleTimeStamp
properties are listed in Table 5-98.
Table 5-98 OracleTimeStamp Properties
Properties | Description |
---|---|
BinData | Returns an array of bytes that represents an Oracle TIMESTAMP in Oracle internal format |
Day | Specifies the day component of an OracleTimeStamp |
IsNull | Indicates whether the OracleTimeStamp instance has a null value |
Hour | Specifies the hour component of an OracleTimeStamp |
Millisecond | Specifies the millisecond component of an OracleTimeStamp |
Minute | Specifies the minute component of an OracleTimeStamp |
Month | Specifies the month component of an OracleTimeStamp |
Nanosecond | Specifies the nanosecond component of an OracleTimeStamp |
Second | Specifies the second component of an OracleTimeStamp |
Value | Specifies the date and time that is stored in the OracleTimeStamp structure |
Year | Specifies the year component of an OracleTimeStamp |
This property returns an array of bytes that represents an Oracle TIMESTAMP
in Oracle internal format.
// C# public byte[] BinData {get;}
A byte array that represents an Oracle TIMESTAMP
in an internal format.
OracleNullValueException
- The current instance has a null value.
This property specifies the day component of an OracleTimeStamp.
// C# public int Day{get;}
A number that represents the day. Range of Day
is (1 to 31).
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull{get;}
Returns true
if the current instance has a null value; otherwise, returns false
.
This property specifies the hour component of an OracleTimeStamp
.
// C# public int Hour{get;}
A number that represents the hour. Range of hour
is (0 to 23).
OracleNullValueException
- The current instance has a null value.
This property gets the millisecond component of an OracleTimeStamp.
// C# public double Millisecond{get;}
A number that represents a millisecond. Range of Millisecond
is (0 to 999.999999).
OracleNullValueException
- The current instance has a null value.
This property gets the minute component of an OracleTimeStamp.
// C# public int Minute{get;}
A number that represent a minute. Range of Minute
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property gets the month component of an OracleTimeStamp
.
// C# public int Month{get;}
A number that represents a month. Range of Month
is (1 to 12).
OracleNullValueException
- The current instance has a null value.
This property gets the nanosecond component of an OracleTimeStamp.
// C# public int Nanosecond{get;}
A number that represents a nanosecond. Range of Nanosecond
is (0 to 999999999).
OracleNullValueException
- The current instance has a null value.
This property gets the second component of an OracleTimeStamp.
// C# public int Second{get;}
A number that represents a second. Range of Second
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property specifies the date and time that is stored in the OracleTimeStamp
structure.
// C# public DateTime Value{get;}
A DateTime
.
OracleNullValueException
- The current instance has a null value.
This property gets the year component of an OracleTimeStamp.
// C# public int Year{get;}
A number that represents a year. The range of Year
is (-4712 to 9999).
OracleNullValueException
- The current instance has a null value.
The OracleTimeStamp
methods are listed in Table 5-99.
Table 5-99 OracleTimeStamp Methods
Methods | Description |
---|---|
AddDays | Adds the supplied number of days to the current instance |
AddHours | Adds the supplied number of hours to the current instance |
AddMilliseconds | Adds the supplied number of milliseconds to the current instance |
AddMinutes | Adds the supplied number of minutes to the current instance |
AddMonths | Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears | Adds the supplied number of years to the current instance |
CompareTo | Compares the current OracleTimeStamp instance to an object, and returns an integer that represents their relative values |
Equals | Determines whether an object has the same date and time as the current OracleTimeStamp instance (Overloaded) |
GetHashCode | Returns a hash code for the OracleTimeStamp instance |
GetDaysBetween | Subtracts an OracleTimeStamp value from the current instance and returns an OracleIntervalDS that represents the time difference between the supplied OracleTimeStamp and the current instance |
GetYearsBetween | Subtracts value1 from the current instance and returns an OracleIntervalYM that represents the difference between value1 and the current instance using OracleIntervalYM |
GetType | Inherited from Object |
ToOracleDate | Converts the current OracleTimeStamp structure to an OracleDate structure |
ToOracleTimeStampLTZ | Converts the current OracleTimeStamp structure to an OracleTimeStampLTZ structure |
ToOracleTimeStampTZ | Converts the current OracleTimeStamp structure to an OracleTimeStampTZ structure |
ToString | Converts the current OracleTimeStamp structure to a string |
This method adds the supplied number of days to the current instance.
// C# public OracleTimeStamp AddDays(double days);
days
The supplied number of days. Range is (-1,000,000,000 < days
< 1,000,000,000)
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of hours to the current instance.
// C# public OracleTimeStamp AddHours(double hours);
hours
The supplied number of hours. Range is (-24,000,000,000 < hours
< 24,000,000,000).
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of milliseconds to the current instance.
// C# public OracleTimeStamp AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds
< 8.64 * 1016).
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of minutes to the current instance.
// C# public OracleTimeStamp AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes
< 1,440,000,000,000).
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of months to the current instance.
// C# public OracleTimeStamp AddMonths(long months);
months
The supplied number of months. Range is (-12,000,000,000 < months
< 12,000,000,000).
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of nanoseconds to the current instance.
// C# public OracleTimeStamp AddNanoseconds(long nanoseconds);
nanoseconds
The supplied number of nanoseconds.
An OracleTimeStamp
.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C# public OracleTimeStamp AddSeconds(double seconds);
seconds
The supplied number of seconds. Range is (-8.64 * 1013< seconds
< 8.64 * 1013).
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of years to the current instance.
// C# public OracleTimeStamp AddYears(int years);
years
The supplied number of years. Range is (-999,999,999 <= years
< = 999,999,999)
An OracleTimeStamp
.
ArgumentOutofRangeException
- The argument value is out of the specified range.
OracleNullValueException
- The current instance has a null value.
This method compares the current OracleTimeStamp
instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The object being compared to the current OracleTimeStamp
instance.
The method returns a number that is:
Less than zero: if the current OracleTimeStamp
instance value is less than that of obj
.
Zero: if the current OracleTimeStamp
instance and obj
values are equal.
Greater than zero: if the current OracleTimeStamp
instance value is greater than that of obj
.
IComparable
ArgumentException
- The obj
parameter is not of type OracleTimeStamp
.
The following rules apply to the behavior of this method.
The comparison must be between OracleTimeStamp
s. For example, comparing an OracleTimeStamp
instance with an OracleBinary
instance is not allowed. When an OracleTimeStamp
is compared with a different type, an ArgumentException
is thrown.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
Overrides Object
This method determines whether an object has the same date and time as the current OracleTimeStamp
instance.
// C# public override bool Equals(object obj);
obj
The object being compared to the current OracleTimeStamp
instance.
Returns true
if the obj
is of type OracleTimeStamp
and represents the same date and time; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStamp
that has a value is greater than an OracleTimeStamp
that has a null value.
Two OracleTimeStamp
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleTimeStamp
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method subtracts an OracleTimeStamp
value from the current instance and returns an OracleIntervalDS
that represents the time difference between the supplied OracleTimeStamp
structure and the current instance.
// C# public OracleIntervalDS GetDaysBetween(OracleTimeStamp value1);
value1
The OracleTimeStamp
value being subtracted.
An OracleIntervalDS
that represents the interval between two OracleTimeStamp
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS
has a null value.
This method subtracts an OracleTimeStamp
value from the current instance and returns an OracleIntervalYM
that represents the time difference between the OracleTimeStamp
value and the current instance.
// C# public OracleIntervalYM GetYearsBetween(OracleTimeStamp value1);
value1
The OracleTimeStamp
value being subtracted.
An OracleIntervalYM
that represents the interval between two OracleTimeStamp
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalYM
has a null value.
This method converts the current OracleTimeStamp
structure to an OracleDate
structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate
contains the date and time in the current instance.
The precision of the OracleTimeStamp
value can be lost during the conversion.
If the value of the OracleTimeStamp
has a null value, the value of the returned OracleDate
structure has a null value.
This method converts the current OracleTimeStamp
structure to an OracleTimeStampLTZ
structure.
// C# public OracleTimeStampLTZ ToOracleTimeStampLTZ();
The returned OracleTimeStampLTZ
contains date and time in the current instance.
If the value of the current instance has a null value, the value of the returned OracleTimeStampLTZ
structure has a null value.
This method converts the current OracleTimeStamp
structure to an OracleTimeStampTZ
structure.
// C# public OracleTimeStampTZ ToOracleTimeStampTZ();
The returned OracleTimeStampTZ
contains the date and time from the OracleTimeStamp
and the time zone from the OracleGlobalization.TimeZone
of the thread.
If the value of the current instance has a null value, the value of the returned OracleTimeStampTZ
structure has a null value.
Overrides Object
This method converts the current OracleTimeStamp
structure to a string.
// C# public override string ToString();
A string
that represents the same date and time as the current OracleTimeStamp
structure.
The returned value is a string representation of an OracleTimeStamp
in the format specified by the OracleGlobalization
.TimeStampFormat
property of the thread.
The names and abbreviations used for months and days are in the language specified by the OracleGlobalization
's DateLanguage
and Calendar
properties of the thread. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStamp(string)constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStamp from a string using the format specified. OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
The OracleTimeStampLTZ
structure represents the Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
data type to be stored in or retrieved from a database. Each OracleTimeStampLTZ
stores the following information: year, month, day, hour, minute, second, and nanosecond.
Object
ValueType
OracleTimeStampLTZ
// C# public struct OracleTimeStampLTZ : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleTimeStampLTZ // Display Local Time Zone Name Console.WriteLine("Local Time Zone Name = " + OracleTimeStampLTZ.GetLocalTimeZoneName()); OracleTimeStampLTZ tsLocal1 = OracleTimeStampLTZ.GetSysDate(); OracleTimeStampLTZ tsLocal2 = DateTime.Now; // Calculate the difference between tsLocal1 and tsLocal2 OracleIntervalDS idsDiff = tsLocal2.GetDaysBetween(tsLocal1); // Calculate the difference using AddNanoseconds() int nanoDiff = 0; while (tsLocal2 > tsLocal1) { nanoDiff += 10; tsLocal1 = tsLocal1.AddNanoseconds(10); } Console.WriteLine("idsDiff.Nanoseconds = " + idsDiff.Nanoseconds); Console.WriteLine("nanoDiff = " + nanoDiff);
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
See Also: |
OracleTimeStampLTZ
members are listed in the following tables:
OracleTimeStampLTZ
constructors are listed in Table 5-100
Table 5-100 OracleTimeStampLTZConstructors
Constructor | Description |
---|---|
OracleTimeStampLTZ Constructors | Instantiates a new instance of OracleTimeStampLTZ structure (Overloaded) |
The OracleTimeStampLTZ
static fields are listed in Table 5-101.
Table 5-101 OracleTimeStampLTZ Static Fields
Field | Description |
---|---|
MaxValue |
Represents the maximum valid date for an OracleTimeStampLTZ structure, which is December 31, 9999 23:59:59.999999999 |
MinValue |
Represents the minimum valid date for an OracleTimeStampLTZ structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStampLTZ structure |
The OracleTimeStampLTZ
static methods are listed in Table 5-102.
Table 5-102 OracleTimeStampLTZ Static Methods
Methods | Description |
---|---|
Equals |
Determines if two OracleTimeStampLTZ values are equal (Overloaded) |
GetLocalTimeZoneName |
Gets the client's local time zone name |
GetLocalTimeZoneOffset |
Gets the client's local time zone offset relative to UTC |
GetSysDate | Gets an OracleTimeStampLTZ structure that represents the current date and time |
GreaterThan |
Determines if the first of two OracleTimeStampLTZ values is greater than the second |
GreaterThanOrEqual |
Determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second |
LessThan |
Determines if the first of two OracleTimeStampLTZ values is less than the second |
LessThanOrEqual |
Determines if the first of two OracleTimeStampLTZ values is less than or equal to the second |
NotEquals |
Determines if two OracleTimeStampLTZ values are not equal |
Parse | Gets an OracleTimeStampLTZ structure and sets its value for date and time using the supplied string |
SetPrecision |
Returns a new instance of an OracleTimeStampLTZ with the specified fractional second precision |
The OracleTimeStampLTZ
static type operators are listed in Table 5-103.
Table 5-103 OracleTimeStampLTZ Static Operators
Operator | Description |
---|---|
operator+ | Adds the supplied instance value to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure (Overloaded) |
operator == | Determines if two OracleTimeStampLTZ values are equal |
operator > | Determines if the first of two OracleTimeStampLTZ values is greater than the second |
operator >= | Determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second |
operator != | Determines if two OracleTimeStampLTZ values are not equal |
operator < | Determines if the first of two OracleTimeStampLTZ values is less than the second |
operator <= | Determines if the first of two OracleTimeStampLTZ values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure (Overloaded) |
The OracleTimeStampLTZ
static type conversions are listed in Table 5-104.
Table 5-104 OracleTimeStampLTZ Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStampLTZ | Converts an instance value to an OracleTimeStampLTZ structure (Overloaded) |
implicit operator OracleTimeStampLTZ | Converts an instance value to an OracleTimeStampLTZ structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStampLTZ value to a DateTime structure |
The OracleTimeStampLTZ
properties are listed in Table 5-105.
Table 5-105 OracleTimeStampLTZ Properties
Properties | Description |
---|---|
BinData |
Returns an array of bytes that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE in Oracle internal format |
Day |
Specifies the day component of an OracleTimeStampLTZ |
IsNull |
Indicates whether the OracleTimeStampLTZ instance has a null value |
Hour |
Specifies the hour component of an OracleTimeStampLTZ |
Millisecond |
Specifies the millisecond component of an OracleTimeStampLTZ |
Minute |
Specifies the minute component of an OracleTimeStampLTZ |
Month |
Specifies the month component of an OracleTimeStampLTZ |
Nanosecond |
Specifies the nanosecond component of an OracleTimeStampLTZ |
Second |
Specifies the second component of an OracleTimeStampLTZ |
Value |
Specifies the date and time that is stored in the OracleTimeStampLTZ structure |
Year |
Specifies the year component of an OracleTimeStampLTZ |
The OracleTimeStampLTZ
methods are listed in Table 5-106.
Table 5-106 OracleTimeStampLTZ Methods
Methods | Description |
---|---|
AddDays |
Adds the supplied number of days to the current instance |
AddHours |
Adds the supplied number of hours to the current instance |
AddMilliseconds |
Adds the supplied number of milliseconds to the current instance |
AddMinutes |
Adds the supplied number of minutes to the current instance |
AddMonths |
Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears |
Adds the supplied number of years to the current instance |
CompareTo |
Compares the current OracleTimeStampLTZ instance to an object and returns an integer that represents their relative values |
Equals |
Determines whether an object has the same date and time as the current OracleTimeStampLTZ instance (Overloaded) |
GetHashCode |
Returns a hash code for the OracleTimeStampLTZ instance |
GetDaysBetween |
Subtracts an OracleTimeStampLTZ from the current instance and returns an OracleIntervalDS that represents the difference |
GetYearsBetween |
Subtracts an OracleTimeStampLTZ from the current instance and returns an OracleIntervalYM that represents the difference |
GetType | Inherited from Object |
ToOracleDate |
Converts the current OracleTimeStampLTZ structure to an OracleDate structure |
ToOracleTimeStamp |
Converts the current OracleTimeStampLTZ structure to an OracleTimeStamp structure |
ToOracleTimeStampTZ |
Converts the current OracleTimeStampLTZ structure to an OracleTimeStampTZ structure |
ToString |
Converts the current OracleTimeStampLTZ structure to a string |
ToUniversalTime |
Converts the current local time to Coordinated Universal Time (UTC) |
The OracleTimeStampLTZ
constructors create new instances of the OracleTimeStampLTZ
structure.
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using the supplied DateTime
value.
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using the supplied string.
OracleTimeStampLTZ(int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date using year, month, and day.
OracleTimeStampLTZ(int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, and second.
OracleTimeStampLTZ(int, int, int, int, int, int, double)
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
OracleTimeStampLTZ(int, int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
format.
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using the supplied DateTime
value.
// C# public OracleTimeStampLTZ (DateTime dt);
dt
The supplied DateTime
value.
ArgumentException
- The dt
parameter cannot be used to construct a valid OracleTimeStampLTZ
.
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using the supplied string.
// C# public OracleTimeStampLTZ(string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
or the supplied tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStampLTZ(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampLTZ from a string using the format specified. OracleTimeStampLTZ ts=new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date using year, month, and day.
// C# public OracleTimeStampLTZ(int year, int month, int day);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampLTZ
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C# public OracleTimeStampLTZ (int year, int month, int day, int hour, int minute, int second);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampLTZ
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C# public OracleTimeStampLTZ(int year, int month, int day, int hour, int minute, int second, double millisecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
milliSeconds
The milliseconds provided. Range of millisecond
is (0 to 999.999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampLTZ
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C# public OracleTimeStampLTZ (int year, int month, int day, int hour, int minute, int second, int nanosecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
nanosecond
The nanosecond provided. Range of nanosecond
is (0 to 999999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampLTZ
(that is, the day is out of range for the month).
This constructor creates a new instance of the OracleTimeStampLTZ
structure and sets its value to the provided byte array, which is in the internal Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
format.
// C# public OracleTimeStampLTZ (byte[] bytes);
bytes
A byte array that represents an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
in Oracle internal format.
ArgumentException
- bytes
is not in an internal Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
format or bytes
is not a valid Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
.
ArgumentNullException
- bytes
is null.
The OracleTimeStampLTZ
static fields are listed in Table 5-107.
Table 5-107 OracleTimeStampLTZ Static Fields
Field | Description |
---|---|
MaxValue |
Represents the maximum valid date for an OracleTimeStampLTZ structure, which is December 31, 9999 23:59:59.999999999 |
MinValue |
Represents the minimum valid date for an OracleTimeStampLTZ structure, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStampLTZ structure |
This static field represents the maximum valid date for an OracleTimeStampLTZ
structure, which is December 31, 9999 23:59:59.999999999.
// C# public static readonly OracleTimeStampLTZ MaxValue;
This value is the maximum date and time in the client time zone.
This static field represents the minimum valid date for an OracleTimeStampLTZ
structure, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStampLTZ MinValue;
This value is the minimum date and time in the client time zone.
This static field represents a null value that can be assigned to an instance of the OracleTimeStampLTZ
structure.
// C# public static readonly OracleTimeStampLTZ Null;
The OracleTimeStampLTZ
static methods are listed in Table 5-108.
Table 5-108 OracleTimeStampLTZ Static Methods
Methods | Description |
---|---|
Equals |
Determines if two OracleTimeStampLTZ values are equal (Overloaded) |
GetLocalTimeZoneName |
Gets the client's local time zone name |
GetLocalTimeZoneOffset |
Gets the client's local time zone offset relative to UTC |
GetSysDate | Gets an OracleTimeStampLTZ structure that represents the current date and time |
GreaterThan |
Determines if the first of two OracleTimeStampLTZ values is greater than the second |
GreaterThanOrEqual |
Determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second |
LessThan |
Determines if the first of two OracleTimeStampLTZ values is less than the second |
LessThanOrEqual |
Determines if the first of two OracleTimeStampLTZ values is less than or equal to the second |
NotEquals |
Determines if two OracleTimeStampLTZ values are not equal |
Parse | Gets an OracleTimeStampLTZ structure and sets its value for date and time using the supplied string |
SetPrecision |
Returns a new instance of an OracleTimeStampLTZ with the specified fractional second precision |
This static method determines if two OracleTimeStampLTZ
values are equal.
// C# public static bool Equals(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if two OracleTimeStampLTZ
values are equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method gets the client's local time zone name.
// C# public static string GetLocalTimeZoneName();
A string containing the local time zone.
This static method gets the client's local time zone offset relative to Coordinated Universal Time (UTC).
// C# public static TimeSpan OracleTimeStampLTZ GetLocalTimeZoneOffset( );
A TimeSpan
structure containing the local time zone hours and time zone minutes.
This static method gets an OracleTimeStampLTZ
structure that represents the current date and time.
// C# public static OracleTimeStampLTZ GetSysDate();
An OracleTimeStampLTZ
structure that represents the current date and time.
This static method determines if the first of two OracleTimeStampLTZ
values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first of two OracleTimeStampLTZ
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first of two OracleTimeStampLTZ
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ
values is less than the second.
// C# public static bool LessThan(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first of two OracleTimeStampLTZ
values is less than the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampLTZ
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first of two OracleTimeStampLTZ
values is less than or equal to the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method determines if two OracleTimeStampLTZ
values are not equal.
// C# public static bool NotEquals(OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if two OracleTimeStampLTZ
values are not equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static method creates an OracleTimeStampLTZ
structure and sets its value using the supplied string.
// C# public static OracleTimeStampLTZ Parse(string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
.
An OracleTimeStampLTZ
structure.
ArgumentException
- The tsStr
parameter is an invalid string representation of an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampLTZ from a string using the format specified. OracleTimeStampLTZ ts = OracleTimeStamp.Parse("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This static method returns a new instance of an OracleTimeStampLTZ
with the specified fractional second precision.
// C# public static OracleTimeStampLTZ SetPrecision(OracleTimeStampLTZ value1, int fracSecPrecision);
value1
The provided OracleTimeStampLTZ
object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStampLTZ
structure with the specified fractional second precision
ArgumentOutOfRangeException
- fracSecPrecision
is out of the specified range.
The value specified in the supplied fracSecPrecision
parameter is used to perform a rounding off operation on the supplied OracleTimeStampLTZ
value. Depending on this value, 0
or more trailing zeros are displayed in the string returned by ToString()
.
The OracleTimeStampLTZ
with a value of "December
31,
9999
23:59:59.99
" results in the string "December
31,
9999
23:59:59.99000
" when SetPrecision()
is called with the fractional second precision set to 5
.
The OracleTimeStampLTZ
static type operators are listed in Table 5-109.
Table 5-109 OracleTimeStampLTZ Static Operators
Operator | Description |
---|---|
operator+ | Adds the supplied instance value to the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure (Overloaded) |
operator == | Determines if two OracleTimeStampLTZ values are equal |
operator > | Determines if the first of two OracleTimeStampLTZ values is greater than the second |
operator >= | Determines if the first of two OracleTimeStampLTZ values is greater than or equal to the second |
operator != | Determines if two OracleTimeStampLTZ values are not equal |
operator < | Determines if the first of two OracleTimeStampLTZ values is less than the second |
operator <= | Determines if the first of two OracleTimeStampLTZ values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStampLTZ and returns a new OracleTimeStampLTZ structure (Overloaded) |
operator+
operator+
adds the supplied value to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
operator + (OracleTimeStampLTZ, OracleIntervalDS)
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
operator + (OracleTimeStampLTZ, OracleIntervalYM)
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
operator + (OracleTimeStampLTZ, TimeSpan)
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
// C# public static operator +(OracleTimeStampLTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampLTZ
.
value2
An OracleIntervalDS.
An OracleTimeStampLTZ.
If either parameter has a null value, the returned OracleTimeStampLTZ
has a null value.
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
// C# public static operator +(OracleTimeStampLTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampLTZ
.
value2
An OracleIntervalYM
.
An OracleTimeStampLTZ
.
If either parameter has a null value, the returned OracleTimeStampLTZ
has a null value.
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampLTZ
and returns a new OracleTimeStampLTZ
structure.
// C# public static operator +(OracleTimeStampLTZ value1, TimeSpan value2);
value1
An OracleTimeStampLTZ
.
value2
A TimeSpan
.
An OracleTimeStampLTZ.
If the OracleTimeStampLTZ
instance has a null value, the returned OracleTimeStampLTZ
has a null value.
This static operator determines if two OracleTimeStampLTZ
values are equal.
// C# public static bool operator == (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if they are the same; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ
values is greater than the second.
// C# public static bool operator > (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first OracleTimeStampLTZ
value is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ
values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
An OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first OracleTimeStampLTZ
is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static operator determines if two OracleTimeStampLTZ
values are not equal.
// C# public static bool operator != (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if two OracleTimeStampLTZ
values are not equal; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ
values is less than the second.
// C# public static bool operator < (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first OracleTimeStampLTZ
is less than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampLTZ
values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStampLTZ value1, OracleTimeStampLTZ value2);
value1
First OracleTimeStampLTZ
.
value2
Second OracleTimeStampLTZ
.
Returns true
if the first OracleTimeStampLTZ
is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
operator -
operator-
subtracts the supplied value, from the supplied OracleTimeStampLTZ
value, and returns a new OracleTimeStampLTZ
structure.
operator - (OracleTimeStampLTZ, OracleIntervalDS)
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampLTZ
value, and return a new OracleTimeStampLTZ
structure.
operator - (OracleTimeStampLTZ, OracleIntervalYM)
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampLTZ
value, and returns a new OracleTimeStampLTZ
structure.
operator - (OracleTimeStampLTZ, TimeSpan)
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampLTZ
value, and returns a new OracleTimeStampLTZ
structure.
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampLTZ
value, and return a new OracleTimeStampLTZ
structure.
// C# public static operator - (OracleTimeStampLTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampLTZ
.
value2
An OracleIntervalDS
instance.
An OracleTimeStampLTZ
structure.
If either parameter has a null value, the returned OracleTimeStampLTZ
has a null value.
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampLTZ
value, and returns a new OracleTimeStampLTZ
structure.
// C# public static operator - (OracleTimeStampLTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampLTZ
.
value2
An OracleIntervalYM
.
An OracleTimeStampLTZ
structure.
If either parameter has a null value, the returned OracleTimeStampLTZ
has a null value.
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampLTZ
value, and returns a new OracleTimeStampLTZ
structure.
// C# public static operator -(OracleTimeStampLTZ value1, TimeSpan value2);
value1
An OracleTimeStampLTZ
.
value2
A TimeSpan
.
An OracleTimeStampLTZ
structure.
If the OracleTimeStampLTZ
instance has a null value, the returned OracleTimeStampLTZ
structure has a null value.
The OracleTimeStampLTZ
static type conversions are listed in Table 5-110.
Table 5-110 OracleTimeStampLTZ Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStampLTZ | Converts an instance value to an OracleTimeStampLTZ structure (Overloaded) |
implicit operator OracleTimeStampLTZ | Converts an instance value to an OracleTimeStampLTZ structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStampLTZ value to a DateTime structure |
explicit operator OracleTimeStampLTZ
explicit operator OracleTimeStampLTZ
converts the supplied value to an OracleTimeStampLTZ
structure.
explicit operator OracleTimeStampLTZ(OracleTimeStamp)
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampLTZ
structure.
explicit operator OracleTimeStampLTZ(OracleTimeStampTZ)
This static type conversion operator converts an OracleTimeStampTZ
value to an OracleTimeStampLTZ
structure.
explicit operator OracleTimeStampLTZ(string)
This static type conversion operator converts the supplied string to an OracleTimeStampLTZ
structure.
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampLTZ
structure.
// C# public static explicit operator OracleTimeStampLTZ (OracleTimeStamp value1);
value1
An OracleTimeStamp
.
The OracleTimeStampLTZ
structure contains the date and time of the OracleTimeStampTZ
structure.
If the OracleTimeStamp
structure has a null value, the returned OracleTimeStampLTZ
structure also has a null value.
This static type conversion operator converts an OracleTimeStampTZ
value to an OracleTimeStampLTZ
structure.
// C# public static explicit operator OracleTimeStampLTZ (OracleTimeStampTZ value1);
value1
An OracleTimeStampTZ
instance.
The OracleTimeStampLTZ
structure contains the date and time in the OracleTimeStampTZ
structure (which is normalized to the client local time zone).
If the OracleTimeStampTZ
structure has a null value, the returned OracleTimeStampLTZ
structure also has a null value.
This static type conversion operator converts the supplied string to an OracleTimeStampLTZ
structure.
// C# public static explicit operator OracleTimeStampLTZ (string tsStr);
tsStr
A string representation of an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
.
A OracleTimeStampLTZ
.
ArgumentException
- ThetsStr
parameter is an invalid string representation of an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the thread's OracleGlobalization
.TimeStampFormat
property, which represents Oracle's NLS_TIMESTAMP_FORMAT
parameter.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStampLTZ(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampLTZ from a string using the format specified. OracleTimeStampLTZ ts=new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
implicit operator OracleTimeStampLTZ
implicit operator OracleTimeStampLTZ
converts the supplied structure to an OracleTimeStampLTZ
structure.
implicit operator OracleTimeStampLTZ(OracleDate)
This static type conversion operator converts an OracleDate
value to an OracleTimeStampLTZ
structure.
implicit operator OracleTimeStampLTZ(DateTime)
This static type conversion operator converts a DateTime
structure to an OracleTimeStampLTZ
structure.
This static type conversion operator converts an OracleDate
value to an OracleTimeStampLTZ
structure.
// C# public static implicit operator OracleTimeStampLTZ(OracleDate value1);
value1
An OracleDate
.
The returned OracleTimeStampLTZ
structure contains the date and time in the OracleDate
structure.
If the OracleDate
structure has a null value, the returned OracleTimeStampLTZ
structure also has a null value.
This static type conversion operator converts a DateTime
structure to an OracleTimeStampLTZ
structure.
// C# public static implicit operator OracleTimeStampLTZ(DateTime value1);
value1
A DateTime
structure.
An OracleTimeStampLTZ
structure.
This static type conversion operator converts an OracleTimeStampLTZ
value to a DateTime
structure.
// C# public static explicit operator DateTime(OracleTimeStampLTZ value1);
value1
An OracleTimeStampLTZ
instance.
A DateTime
that contains the date and time in the current instance.
OracleNullValueException
- The OracleTimeStampLTZ
structure has a null value.
The precision of the OracleTimeStampLTZ
value can be lost during the conversion.
The OracleTimeStampLTZ
properties are listed in Table 5-111.
Table 5-111 OracleTimeStampLTZ Properties
Properties | Description |
---|---|
BinData |
Returns an array of bytes that represents an Oracle TIMESTAMP WITH LOCAL TIME ZONE in Oracle internal format |
Day |
Specifies the day component of an OracleTimeStampLTZ |
IsNull |
Indicates whether the OracleTimeStampLTZ instance has a null value |
Hour |
Specifies the hour component of an OracleTimeStampLTZ |
Millisecond |
Specifies the millisecond component of an OracleTimeStampLTZ |
Minute |
Specifies the minute component of an OracleTimeStampLTZ |
Month |
Specifies the month component of an OracleTimeStampLTZ |
Nanosecond |
Specifies the nanosecond component of an OracleTimeStampLTZ |
Second |
Specifies the second component of an OracleTimeStampLTZ |
Value |
Specifies the date and time that is stored in the OracleTimeStampLTZ structure |
Year |
Specifies the year component of an OracleTimeStampLTZ |
This property returns an array of bytes that represents an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
in Oracle internal format.
// C# public byte[] BinData {get;}
A byte array that represents an Oracle TIMESTAMP
WITH
LOCAL
TIME
ZONE
internal format.
OracleNullValueException
- The current instance has a null value.
This property specifies the day component of an OracleTimeStampLTZ.
// C# public int Day{get;}
A number that represents the day. Range of Day
is (1 to 31).
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull{get;}
Returns true
if the current instance contains a null value; otherwise, returns false
.
This property specifies the hour component of an OracleTimeStampLTZ
.
// C# public int Hour{get;}
A number that represents the hour. Range of Hour
is (0 to 23).
OracleNullValueException
- The current instance has a null value.
This property gets the millisecond component of an OracleTimeStampLTZ
.
// C# public double Millisecond{get;}
A number that represents a millisecond. Range of Millisecond
is (0 to 999.999999)
OracleNullValueException
- The current instance has a null value.
This property gets the minute component of an OracleTimeStampLTZ.
// C# public int Minute{get;}
A number that represent a minute. Range of Minute
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property gets the month component of an OracleTimeStampLTZ
.
// C# public int Month{get;}
A number that represents a month. Range of Month
is (1 to 12).
OracleNullValueException
- The current instance has a null value.
This property gets the nanosecond component of an OracleTimeStampLTZ
.
// C# public int Nanosecond{get;}
A number that represents a nanosecond. Range of Nanosecond
is (0 to 999999999).
OracleNullValueException
- The current instance has a null value.
This property gets the second component of an OracleTimeStampLTZ
.
// C# public int Second{get;}
A number that represents a second. Range of Second
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property specifies the date and time that is stored in the OracleTimeStampLTZ
structure.
// C# public DateTime Value{get;}
A DateTime
.
OracleNullValueException
- The current instance has a null value.
This property gets the year component of an OracleTimeStampLTZ
.
// C# public int Year{get;}
A number that represents a year. The range of Year
is (-4712 to 9999).
OracleNullValueException
- The current instance has a null value.
The OracleTimeStampLTZ
methods are listed in Table 5-112.
Table 5-112 OracleTimeStampLTZ Methods
Methods | Description |
---|---|
AddDays |
Adds the supplied number of days to the current instance |
AddHours |
Adds the supplied number of hours to the current instance |
AddMilliseconds |
Adds the supplied number of milliseconds to the current instance |
AddMinutes |
Adds the supplied number of minutes to the current instance |
AddMonths |
Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears |
Adds the supplied number of years to the current instance |
CompareTo |
Compares the current OracleTimeStampLTZ instance to an object and returns an integer that represents their relative values |
Equals |
Determines whether an object has the same date and time as the current OracleTimeStampLTZ instance (Overloaded) |
GetHashCode |
Returns a hash code for the OracleTimeStampLTZ instance |
GetDaysBetween |
Subtracts an OracleTimeStampLTZ from the current instance and returns an OracleIntervalDS that represents the difference |
GetYearsBetween |
Subtracts an OracleTimeStampLTZ from the current instance and returns an OracleIntervalYM that represents the difference |
GetType | Inherited from Object |
ToOracleDate |
Converts the current OracleTimeStampLTZ structure to an OracleDate structure |
ToOracleTimeStamp |
Converts the current OracleTimeStampLTZ structure to an OracleTimeStamp structure |
ToOracleTimeStampTZ |
Converts the current OracleTimeStampLTZ structure to an OracleTimeStampTZ structure |
ToString |
Converts the current OracleTimeStampLTZ structure to a string |
ToUniversalTime |
Converts the current local time to Coordinated Universal Time (UTC) |
This method adds the supplied number of days to the current instance.
// C# public OracleTimeStampLTZ AddDays(double days);
days
The supplied number of days. Range is (-1,000,000,000 < days
< 1,000,000,000)
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of hours to the current instance.
// C# public OracleTimeStampLTZ AddHours(double hours);
hours
The supplied number of hours. Range is (-24,000,000,000 < hours
< 24,000,000,000).
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of milliseconds to the current instance.
// C# public OracleTimeStampLTZ AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds
< 8.64 * 1016).
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of minutes to the current instance.
// C# public OracleTimeStampLTZ AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes
< 1,440,000,000,000).
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of months to the current instance.
// C# public OracleTimeStampLTZ AddMonths(long months);
months
The supplied number of months. Range is (-12,000,000,000 < months
< 12,000,000,000).
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of nanoseconds to the current instance.
// C# public OracleTimeStampLTZ AddNanoseconds(long nanoseconds);
nanoseconds
The supplied number of nanoseconds.
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C# public OracleTimeStampLTZ AddSeconds(double seconds);
seconds
The supplied number of seconds. Range is (-8.64 * 1013< seconds
< 8.64 * 1013).
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of years to the current instance
// C# public OracleTimeStampLTZ AddYears(int years);
years
The supplied number of years. Range is (-999,999,999 <= years
< = 999,999,999)
An OracleTimeStampLTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method compares the current OracleTimeStampLTZ
instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The object being compared to the current OracleTimeStampLTZ
instance.
The method returns a number that is:
Less than zero: if the current OracleTimeStampLTZ
instance value is less than that of obj
.
Zero: if the current OracleTimeStampLTZ
instance and obj
values are equal.
Greater than zero: if the current OracleTimeStampLTZ
instance value is greater than that of obj
.
IComparable
ArgumentException
- The obj
parameter is not of type OracleTimeStampLTZ
.
The following rules apply to the behavior of this method.
The comparison must be between OracleTimeStampLTZ
s. For example, comparing an OracleTimeStampLTZ
instance with an OracleBinary
instance is not allowed. When an OracleTimeStampLTZ
is compared with a different type, an ArgumentException
is thrown.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
Overrides Object
This method determines whether an object has the same date and time as the current OracleTimeStampLTZ
instance.
// C# public override bool Equals(object obj);
obj
The object being compared to the current OracleTimeStampLTZ
instance.
Returns true
if the obj
is of type OracleTimeStampLTZ
and represents the same date and time; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampLTZ
that has a value is greater than an OracleTimeStampLTZ
that has a null value.
Two OracleTimeStampLTZ
s that contain a null value are equal.
Overrides Object
This method returns a hash code for the OracleTimeStampLTZ
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method subtracts an OracleTimeStampLTZ
value from the current instance and returns an OracleIntervalDS
that represents the difference.
// C# public OracleIntervalDS GetDaysBetween(OracleTimeStampLTZ value1);
value1
The OracleTimeStampLTZ
value being subtracted.
An OracleIntervalDS
that represents the interval between two OracleTimeStampLTZ
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS
has a null value.
This method subtracts an OracleTimeStampLTZ
value from the current instance and returns an OracleIntervalYM
that represents the time interval.
// C# public OracleIntervalYM GetYearsBetween(OracleTimeStampLTZ value1);
value1
The OracleTimeStampLTZ
value being subtracted.
An OracleIntervalYM
that represents the interval between two OracleTimeStampLTZ
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalYM
has a null value.
This method converts the current OracleTimeStampLTZ
structure to an OracleDate
structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate
structure contains the date and time in the current instance.
The precision of the OracleTimeStampLTZ
value can be lost during the conversion.
If the current instance has a null value, the value of the returned OracleDate
structure has a null value.
This method converts the current OracleTimeStampLTZ
structure to an OracleTimeStamp
structure.
// C# public OracleTimeStamp ToOracleTimeStamp();
The returned OracleTimeStamp
contains the date and time in the current instance.
If the current instance has a null value, the value of the returned OracleTimeStamp
structure has a null value.
This method converts the current OracleTimeStampLTZ
structure to an OracleTimeStampTZ
structure.
// C# public OracleTimeStampTZ ToOracleTimeStampTZ();
The returned OracleTimeStampTZ
contains the date and time of the current instance, with the time zone set to the OracleGlobalization.TimeZone
from the thread.
If the current instance has a null value, the value of the returned OracleTimeStampTZ
structure has a null value.
Overrides Object
This method converts the current OracleTimeStampLTZ
structure to a string.
// C# public override string ToString();
A string
that represents the same date and time as the current OracleTimeStampLTZ
structure.
The returned value is a string representation of the OracleTimeStampLTZ
in the format specified by the OracleGlobalization
.TimeStampFormat
property of the thread.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_format for the OracleTimeStampLTZ(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampLTZ from a string using the format specified. OracleTimeStampLTZ ts=new OracleTimeStampLTZ("11-NOV-1999 11:02:33.444 AM"); // Set the nls_timestamp_format for the ToString() method og.TimeStampFormat = "YYYY-MON-DD HH:MI:SS.FF AM"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(ts.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM"
This method converts the current local time to Coordinated Universal Time (UTC).
// C# public OracleTimeStampTZ ToUniversalTime();
An OracleTimeStampTZ
structure.
If the current instance has a null value, the value of the returned OracleTimeStampTZ
structure has a null value.
The OracleTimeStampTZ
structure represents the Oracle TIMESTAMP
WITH
TIME
ZONE
data type to be stored in or retrieved from a database. Each OracleTimeStampTZ
stores the following information: year, month, day, hour, minute, second, nanosecond, and time zone.
Object
ValueType
OracleTimeStampTZ
// C# public struct OracleTimeStampTZ : IComparable
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
// C# // Illustrates usage of OracleTimeStampTZ // Set the nls parameters for the current thread OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeZone = "US/Eastern"; og.TimeStampFormat = "DD-MON-YYYY HH:MI:SS.FF AM"; og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // Create an OracleTimeStampTZ in US/Pacific time zone OracleTimeStampTZ tstz1=new OracleTimeStampTZ("11-NOV-1999 "+ "11:02:33.444 AM US/Pacific"); // Note that ToOracleTimeStampTZ uses the thread's time zone region,"US/Eastern" OracleTimeStamp ts = new OracleTimeStamp("11-NOV-1999 11:02:33.444 AM"); OracleTimeStampTZ tstz2 = ts.ToOracleTimeStampTZ(); // Calculate the difference between tstz1 and tstz2 OracleIntervalDS idsDiff = tstz1.GetDaysBetween(tstz2); // Display information Console.WriteLine("tstz1.TimeZone = " + tstz1.TimeZone); //Prints "US/Pacific" Console.WriteLine("tstz2.TimeZone = " + tstz2.TimeZone); // Prints "US/Eastern" Console.WriteLine("idsDiff.Hours = " + idsDiff.Hours); // Prints 3 Console.WriteLine("idsDiff.Minutes = " + idsDiff.Minutes); // Prints 0
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
See Also: |
OracleTimeStampTZ
members are listed in the following tables:
OracleTimeStampTZ
constructors are listed in Table 5-113
Table 5-113 OracleTimeStampTZ Constructors
Constructor | Description |
---|---|
OracleTimeStampTZ Constructors |
Instantiates a new instance of OracleTimeStampTZ structure (Overloaded) |
The OracleTimeStampTZ
static fields are listed in Table 5-114.
Table 5-114 OracleTimeStampTZ Static Fields
Field | Description |
---|---|
MaxValue |
Represents the maximum valid date for an OracleTimeStampTZ structure in UTC, which is December 31, 999923:59:59.999999999 |
MinValue |
Represents the minimum valid date for an OracleTimeStampTZ structure in UTC, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStampTZ structure |
The OracleTimeStampTZ
static methods are listed in Table 5-115.
Table 5-115 OracleTimeStampTZ Static Methods
Methods | Description |
---|---|
Equals |
Determines if two OracleTimeStampTZ values are equal (Overloaded) |
GetSysDate | Gets an OracleTimeStampTZ structure that represents the current date and time |
GreaterThan |
Determines if the first of two OracleTimeStampTZ values is greater than the second |
GreaterThanOrEqual |
Determines if the first of two OracleTimeStampTZ values is greater than or equal to the second |
LessThan |
Determines if the first of two OracleTimeStampTZ values is less than the second |
LessThanOrEqual |
Determines if the first of two OracleTimeStampTZ values is less than or equal to the second |
NotEquals |
Determines if two OracleTimeStampTZ values are not equal |
Parse | Gets an OracleTimeStampTZ structure and sets its value for date and time using the supplied string |
SetPrecision |
Returns a new instance of an OracleTimeStampTZ with the specified fractional second precision |
The OracleTimeStampTZ
static operators are listed in Table 5-116.
Table 5-116 OracleTimeStampTZ Static Operators
Operator | Description |
---|---|
operator + | Adds the supplied instance value to the supplied OracleTimeStampTZ and returns a new OracleTimeStampTZ structure (Overloaded) |
operator == | Determines if two OracleTimeStampTZ values are equal |
operator > | Determines if the first of two OracleTimeStampTZ values is greater than the second |
operator >= | Determines if the first of two OracleTimeStampTZ values is greater than or equal to the second |
operator != | Determines if two OracleTimeStampTZ values are not equal |
operator < | Determines if the first of two OracleTimeStampTZ values is less than the second |
operator <= | Determines if the first of two OracleTimeStampTZ values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStampTZ and returns a new OracleTimeStampTZ structure (Overloaded) |
The OracleTimeStampTZ
static type conversions are listed in Table 5-117.
Table 5-117 OracleTimeStampTZ Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStampTZ | Converts an instance value to an OracleTimeStampTZ structure (Overloaded) |
implicit operator OracleTimeStampTZ | Converts an instance value to an OracleTimeStampTZ structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStampTZ value to a DateTime structure in the current time zone |
The OracleTimeStampTZ
properties are listed in Table 5-118.
Table 5-118 OracleTimeStampTZ Properties
Properties | Description |
---|---|
BinData |
Returns an array of bytes that represents an Oracle TIMESTAMP WITH TIME ZONE in Oracle internal format |
Day |
Specifies the day component of an OracleTimeStampTZ in the current time zone |
IsNull |
Indicates whether the current instance has a null value |
Hour |
Specifies the hour component of an OracleTimeStampTZ in the current time zone |
Millisecond |
Specifies the millisecond component of an OracleTimeStampTZ in the current time zone |
Minute |
Specifies the minute component of an OracleTimeStampTZ in the current time zone |
Month |
Specifies the month component of an OracleTimeStampTZ in the current time zone |
Nanosecond |
Specifies the nanosecond component of an OracleTimeStampTZ in the current time zone |
Second |
Specifies the second component of an OracleTimeStampTZ in the current time zone |
TimeZone |
Returns the time zone of the OracleTimeStampTZ instance |
Value |
Returns the date and time that is stored in the OracleTimeStampTZ structure in the current time zone |
Year |
Specifies the year component of an OracleTimeStampTZ |
The OracleTimeStampTZ
methods are listed in Table 5-119.
Table 5-119 OracleTimeStampTZ Methods
Methods | Description |
---|---|
AddDays |
Adds the supplied number of days to the current instance |
AddHours |
Adds the supplied number of hours to the current instance |
AddMilliseconds |
Adds the supplied number of milliseconds to the current instance |
AddMinutes |
Adds the supplied number of minutes to the current instance |
AddMonths |
Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears |
Adds the supplied number of years to the current instance |
CompareTo |
Compares the current OracleTimeStampTZ instance to an object, and returns an integer that represents their relative values |
Equals |
Determines whether an object has the same date and time as the current OracleTimeStampTZ instance |
GetDaysBetween |
Subtracts an OracleTimeStampTZ from the current instance and returns an OracleIntervalDS that represents the time interval |
GetHashCode |
Returns a hash code for the OracleTimeStampTZ instance |
GetTimeZoneOffset |
Gets the time zone information in hours and minutes of the current OracleTimeStampTZ |
GetYearsBetween |
Subtracts an OracleTimeStampTZ from the current instance and returns an OracleIntervalYM that represents the time interval |
GetType | Inherited from Object |
ToLocalTime |
Converts the current OracleTimeStampTZ instance to local time |
ToOracleDate |
Converts the current OracleTimeStampTZ structure to an OracleDate structure |
ToOracleTimeStampLTZ |
Converts the current OracleTimeStampTZ structure to an OracleTimeStampLTZ structure |
ToOracleTimeStamp |
Converts the current OracleTimeStampTZ structure to an OracleTimeStamp structure |
ToString |
Converts the current OracleTimeStampTZ structure to a string |
ToUniversalTime |
Converts the current datetime to Coordinated Universal Time (UTC) |
The OracleTimeStampTZ
constructors create new instances of the OracleTimeStampTZ
structure.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value.
OracleTimeStampTZ(DateTime, string)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value and the supplied time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
OracleTimeStampTZ(int, int, int)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, and day.
OracleTimeStampTZ(int, int, int, string)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, and time zone data.
OracleTimeStampTZ(int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, and second.
OracleTimeStampTZ(int, int, int, int, int, int, string)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and time zone data.
OracleTimeStampTZ(int, int, int, int, int, int, double)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
OracleTimeStampTZ(int, int, int, int, int, int, double, string)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, millisecond, and time zone data.
OracleTimeStampTZ(int, int, int, int, int, int, int)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
OracleTimeStampTZ(int, int, int, int, int, int, int, string)
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, nanosecond, and time zone data.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value to the provided byte array, that represents the internal Oracle TIMESTAMP
WITH
TIME
ZONE
format.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied DateTime
value.
// C# public OracleTimeStampTZ (DateTime dt);
dt
The supplied DateTime
value.
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
ArgumentException
- The dt
parameter cannot be used to construct a valid OracleTimeStampTZ
.
This constructor creates a new instance of the OracleTimeStampTZ
structure with the supplied DateTime
value and the time zone data.
// C# public OracleTimeStampTZ (DateTime value1, string timeZone);
value1
The supplied DateTime
value.
timeZone
The time zone data provided.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
.
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
Note: PST is a time zone region name as well as a time zone abbreviation, therefore it is accepted byOracleTimeStampTZ . |
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
// C# public OracleTimeStampTZ (string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_tz_format OracleTimeStampTZ(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, and day.
// C# public OracleTimeStampTZ(int year, int month, int day);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, and time zone data.
// C# public OracleTimeStampTZ(int year, int month, int day, string timeZone);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
timeZone
The time zone data provided.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
Note: PST is a time zone region name as well as a time zone abbreviation, therefore it is accepted byOracleTimeStampTZ . |
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, and second.
// C# public OracleTimeStampTZ(int year, int month, int day, int hour, int minute, int second);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and time zone data.
// C# public OracleTimeStampTZ (int year, int month, int day, int hour, int minute, int second, string timeZone);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
timeZone
The time zone data provided.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range of the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
Note: PST is a time zone region name as well as a time zone abbreviation, therefore it is accepted byOracleTimeStampTZ . |
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and millisecond.
// C# public OracleTimeStampTZ(int year, int month, int day, int hour, int minute, int second, double millisecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
millisecond
The millisecond provided. Range of millisecond
is (0 to 999.999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, millisecond, and time zone data.
// C# public OracleTimeStampTZ(int year, int month, int day, int hour, int minute, int second, double millisecond, string timeZone);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
millisecond
The millisecond provided. Range of millisecond
is (0 to 999.999999).
timeZone
The time zone data provided.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
Note: PST is a time zone region name as well as a time zone abbreviation, therefore it is accepted byOracleTimeStampTZ . |
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, and nanosecond.
// C# public OracleTimeStampTZ(int year, int month, int day, int hour, int minute, int second, int nanosecond);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
nanosecond
The nanosecond provided. Range of nanosecond
is (0 to 999999999).
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month).
The time zone is set to the OracleGlobalization.TimeZone
of the thread.
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value for date and time using year, month, day, hour, minute, second, nanosecond, and time zone data.
// C# public OracleTimeStampTZ(int year, int month, int day, int hour, int minute, int second, int nanosecond, string timeZone);
year
The year provided. Range of year
is (-4712 to 9999).
month
The month provided. Range of month
is (1 to 12).
day
The day provided. Range of day
is (1 to 31).
hour
The hour provided. Range of hour
is (0 to 23).
minute
The minute provided. Range of minute
is (0 to 59).
second
The second provided. Range of second
is (0 to 59).
nanosecond
The nanosecond provided. Range of nanosecond
is (0 to 999999999).
timeZone
The time zone data provided.
ArgumentOutOfRangeException
- The argument value for one or more of the parameters is out of the specified range.
ArgumentException
- The argument values of the parameters cannot be used to construct a valid OracleTimeStampTZ
(that is, the day is out of range for the month or the time zone is invalid).
timeZone
can be either an hour offset, for example, 7:00, or a valid time zone region name that is provided in V$TIMEZONE_NAMES
, such as US/Pacific. Time zone abbreviations are not supported.
If time zone is null, the OracleGlobalization.TimeZone
of the thread is used.
Note: PST is a time zone region name as well as a time zone abbreviation, therefore it is accepted byOracleTimeStampTZ . |
This constructor creates a new instance of the OracleTimeStampTZ
structure and sets its value to the provided byte array, that represents the internal Oracle TIMESTAMP
WITH
TIME
ZONE
format.
// C# public OracleTimeStampLTZ (byte[] bytes);
bytes
The provided byte array that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
ArgumentException
- bytes
is not in internal Oracle TIMESTAMP
WITH
TIME
ZONE
format or bytes
is not a valid Oracle TIMESTAMP
WITH
TIME
ZONE
.
ArgumentNullException
- bytes
is null.
The OracleTimeStampTZ
static fields are listed in Table 5-120.
Table 5-120 OracleTimeStampTZ Static Fields
Field | Description |
---|---|
MaxValue |
Represents the maximum valid date for an OracleTimeStampTZ structure in UTC, which is December 31, 999923:59:59.999999999 |
MinValue |
Represents the minimum valid date for an OracleTimeStampTZ structure in UTC, which is January 1, -4712 0:0:0 |
Null | Represents a null value that can be assigned to an instance of the OracleTimeStampTZ structure |
This static field represents the maximum valid datetime time for an OracleTimeStampTZ
structure in UTC, which is December 31, 999923:59:59.999999999.
// C# public static readonly OracleTimeStampTZ MaxValue;
This static field represents the minimum valid datetime for an OracleTimeStampTZ
structure in UTC, which is January 1, -4712 0:0:0.
// C# public static readonly OracleTimeStampTZ MinValue;
This static field represents a null value that can be assigned to an instance of the OracleTimeStampTZ
structure.
// C# public static readonly OracleTimeStampTZ Null;
The OracleTimeStampTZ
static methods are listed in Table 5-121.
Table 5-121 OracleTimeStampTZ Static Methods
Methods | Description |
---|---|
Equals |
Determines if two OracleTimeStampTZ values are equal (Overloaded) |
GetSysDate | Gets an OracleTimeStampTZ structure that represents the current date and time |
GreaterThan |
Determines if the first of two OracleTimeStampTZ values is greater than the second |
GreaterThanOrEqual |
Determines if the first of two OracleTimeStampTZ values is greater than or equal to the second |
LessThan |
Determines if the first of two OracleTimeStampTZ values is less than the second |
LessThanOrEqual |
Determines if the first of two OracleTimeStampTZ values is less than or equal to the second |
NotEquals |
Determines if two OracleTimeStampTZ values are not equal |
Parse | Gets an OracleTimeStampTZ structure and sets its value for date and time using the supplied string |
SetPrecision |
Returns a new instance of an OracleTimeStampTZ with the specified fractional second precision |
This static method determines if two OracleTimeStampTZ
values are equal.
// C# public static bool Equals(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if two OracleTimeStampTZ
values are equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method gets an OracleTimeStampTZ
structure that represents the current date and time.
// C# public static OracleTimeStampTZ GetSysDate();
An OracleTimeStampTZ
structure that represents the current date and time.
This static method determines if the first of two OracleTimeStampTZ
values is greater than the second.
// C# public static bool GreaterThan(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first of two OracleTimeStampTZ
values is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is greater than or equal to the second.
// C# public static bool GreaterThanOrEqual(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first of two OracleTimeStampTZ
values is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is less than the second.
// C# public static bool LessThan(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first of two OracleTimeStampTZ
values is less than the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if the first of two OracleTimeStampTZ
values is less than or equal to the second.
// C# public static bool LessThanOrEqual(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first of two OracleTimeStampTZ
values is less than or equal to the second. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method determines if two OracleTimeStampTZ
values are not equal.
// C# public static bool NotEquals(OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if two OracleTimeStampTZ
values are not equal. Returns false
otherwise.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static method returns an OracleTimeStampTZ
structure and sets its value for date and time using the supplied string.
// C# public static OracleTimeStampTZ Parse(string tsStr);
tsStr
A string that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
.
An OracleTimeStampTZ
structure.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
or the tsStr
is not in the timestamp format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread, which represents Oracle's NLS_TIMESTAMP_TZ_FORMAT
parameter.
ArgumentNullException
- The tsStr
value is null.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_tz_format for the Parse() method OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = OracleTimeStampTZ.Parse("11-NOV-1999 " + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
This static method returns a new instance of an OracleTimeStampTZ
with the specified fractional second precision.
// C# public static OracleTimeStampTZ SetPrecision(OracleTimeStampTZ value1, int fracSecPrecision);
value1
The provided OracleTimeStampTZ
object.
fracSecPrecision
The fractional second precision provided. Range of fractional second precision is (0 to 9).
An OracleTimeStampTZ
structure with the specified fractional second precision
ArgumentOutOfRangeException
- fracSecPrecision
is out of the specified range.
The value specified in the supplied fracSecPrecision
is used to perform a rounding off operation on the supplied OracleTimeStampTZ
value. Depending on this value, 0
or more trailing zeros are displayed in the string returned by ToString()
.
The OracleTimeStampTZ
with a value of "December 31,
9999
23:59:59.99
US/Pacific
" results in the string "December
31,
9999 23:59:59.99000
US/Pacific
" when SetPrecision()
is called with the fractional second precision set to 5
.
The OracleTimeStampTZ
static operators are listed in Table 5-122.
Table 5-122 OracleTimeStampTZ Static Operators
Operator | Description |
---|---|
operator + | Adds the supplied instance value to the supplied OracleTimeStampTZ and returns a new OracleTimeStampTZ structure (Overloaded) |
operator == | Determines if two OracleTimeStampTZ values are equal |
operator > | Determines if the first of two OracleTimeStampTZ values is greater than the second |
operator >= | Determines if the first of two OracleTimeStampTZ values is greater than or equal to the second |
operator != | Determines if two OracleTimeStampTZ values are not equal |
operator < | Determines if the first of two OracleTimeStampTZ values is less than the second |
operator <= | Determines if the first of two OracleTimeStampTZ values is less than or equal to the second |
operator - | Subtracts the supplied instance value from the supplied OracleTimeStampTZ and returns a new OracleTimeStampTZ structure (Overloaded) |
operator +
operator+
adds the supplied structure to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
operator +(OracleTimeStampTZ, OracleIntervalDS)
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
operator +(OracleTimeStampTZ, OracleIntervalYM)
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
operator +(OracleTimeStampTZ, TimeSpan)
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
This static operator adds the supplied OracleIntervalDS
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampTZ
.
value2
An OracleIntervalDS
.
An OracleTimeStampTZ
.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator adds the supplied OracleIntervalYM
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampTZ
.
value2
An OracleIntervalYM
.
An OracleTimeStampTZ
.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator adds the supplied TimeSpan
to the supplied OracleTimeStampTZ
and returns a new OracleTimeStampTZ
structure.
// C# public static operator +(OracleTimeStampTZ value1, TimeSpan value2);
value1
An OracleTimeStampTZ
.
value2
A TimeSpan.
An OracleTimeStampTZ
.
If the OracleTimeStampTZ
instance has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator determines if two OracleTimeStampTZ
values are equal.
// C# public static bool operator == (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ.
Returns true
if they are equal; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is greater than the second.
// C# public static bool operator > (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first OracleTimeStampTZ
value is greater than the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is greater than or equal to the second.
// C# public static bool operator >= (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first OracleTimeStampTZ
is greater than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if two OracleTimeStampTZ
values are not equal.
// C# public static bool operator != (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if two OracleTimeStampTZ
values are not equal; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is less than the second.
// C# public static bool operator < (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first OracleTimeStampTZ
is less than the second; otherwise returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This static operator determines if the first of two OracleTimeStampTZ
values is less than or equal to the second.
// C# public static bool operator <= (OracleTimeStampTZ value1, OracleTimeStampTZ value2);
value1
First OracleTimeStampTZ
.
value2
Second OracleTimeStampTZ
.
Returns true
if the first OracleTimeStampTZ
is less than or equal to the second; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
operator -
operator-
subtracts the supplied value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
operator - (OracleTimeStampTZ, OracleIntervalDS)
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampTZ
value, and return a new OracleTimeStampTZ
structure.
operator - (OracleTimeStampTZ, OracleIntervalYM)
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
operator - (OracleTimeStampTZ value1, TimeSpan value2)
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
This static operator subtracts the supplied OracleIntervalDS
value, from the supplied OracleTimeStampTZ
value, and return a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, OracleIntervalDS value2);
value1
An OracleTimeStampTZ
.
value2
An OracleIntervalDS
.
An OracleTimeStampTZ
structure.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator subtracts the supplied OracleIntervalYM
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, OracleIntervalYM value2);
value1
An OracleTimeStampTZ
.
value2
An OracleIntervalYM
.
An OracleTimeStampTZ
structure.
If either parameter has a null value, the returned OracleTimeStampTZ
has a null value.
This static operator subtracts the supplied TimeSpan
value, from the supplied OracleTimeStampTZ
value, and returns a new OracleTimeStampTZ
structure.
// C# public static operator - (OracleTimeStampTZ value1, TimeSpan value2);
value1
An OracleTimeStampTZ
.
value2
A TimeSpan
.
An OracleTimeStampTZ
structure.
If the OracleTimeStampTZ
instance has a null value, the returned OracleTimeStampTZ
structure has a null value.
The OracleTimeStampTZ
static type conversions are listed in Table 5-123.
Table 5-123 OracleTimeStampTZ Static Type Conversions
Operator | Description |
---|---|
explicit operator OracleTimeStampTZ | Converts an instance value to an OracleTimeStampTZ structure (Overloaded) |
implicit operator OracleTimeStampTZ | Converts an instance value to an OracleTimeStampTZ structure (Overloaded) |
explicit operator DateTime | Converts an OracleTimeStampTZ value to a DateTime structure in the current time zone |
explicit operator OracleTimeStampTZ
explicit operator OracleTimeStampTZ
converts an instance value to an OracleTimeStampTZ
structure.
explicit operator OracleTimeStampTZ(OracleTimeStamp)
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampTZ
structure.
explicit operator OracleTimeStampTZ(OracleTimeStampLTZ)
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStampTZ
structure.
explicit operator OracleTimeStampTZ(string)
This static type conversion operator converts the supplied string value to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStamp
value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(OracleTimeStamp value1);
value1
An OracleTimeStamp
.
The returned OracleTimeStampTZ
contains the date and time from the OracleTimeStamp
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from an OracleTimeStamp
structure to an OracleTimeStampTZ
structure.
If the OracleTimeStamp
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts an OracleTimeStampLTZ
value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(OracleTimeStampLTZ value1);
value1
An OracleTimeStampLTZ
.
The returned OracleTimeStampTZ
contains the date and time from the OracleTimeStampLTZ
and the time zone from the OracleGlobalization.TimeZone
of the thread.
If the OracleTimeStampLTZ
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts the supplied string value to an OracleTimeStampTZ
structure.
// C# public static explicit operator OracleTimeStampTZ(string tsStr);
tsStr
A string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
.
A OracleTimeStampTZ
value.
ArgumentException
- The tsStr
is an invalid string representation of an Oracle TIMESTAMP
WITH
TIME
ZONE
. or the tsStr
is not in the timestamp format specified by the thread's OracleGlobalization
.TimeStampTZFormat
property, which represents Oracle's NLS_TIMESTAMP_TZ_FORMAT
parameter.
The names and abbreviations used for months and days are in the language specified by the DateLanguage
and Calendar
properties of the thread's OracleGlobalization
object. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_tz_format for the explicit operator // OracleTimeStampTZ(string) OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
implicit operator OracleTimeStampTZ
implicit operator OracleTimeStampTZ
converts a DateTime
structure to an OracleTimeStampTZ
structure.
implicit operator OracleTimeStampTZ(OracleDate)
This static type conversion operator converts an OracleDate
value to an OracleTimeStampTZ
structure.
implicit operator OracleTimeStampTZ(DateTime)
This static type conversion operator converts a DateTime
structure to an OracleTimeStampTZ
structure.
This static type conversion operator converts an OracleDate
value to an OracleTimeStampTZ
structure.
// C# public static implicit operator OracleTimeStampTZ(OracleDate value1);
value1
An OracleDate
.
The returned OracleTimeStampTZ
contains the date and time from the OracleDate
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from an OracleDate
to an OracleTimeStampTZ
structure. If the OracleDate
structure has a null value, the returned OracleTimeStampTZ
structure also has a null value.
This static type conversion operator converts a DateTime
structure to an OracleTimeStampTZ
structure.
// C# public static implicit operator OracleTimeStampTZ (DateTime value1);
value1
A DateTime
structure.
The returned OracleTimeStampTZ
contains the date and time from the DateTime
and the time zone from the OracleGlobalization.TimeZone
of the thread.
The OracleGlobalization.TimeZone
of the thread is used to convert from a DateTime
to an Oracle TimeStampTZ
structure.
This static type conversion operator converts an OracleTimeStampTZ
value to a DateTime
structure in the current time zone.
// C# public static explicit operator DateTime(OracleTimeStampTZ value1);
value1
An OracleTimeStampTZ
.
A DateTime
containing the date and time in the current instance, but with the time zone information in the current instance truncated.
OracleNullValueException
- The OracleTimeStampTZ
structure has a null value.
The precision of the OracleTimeStampTZ
value can be lost during the conversion, and the time zone information in the current instance is truncated
The OracleTimeStampTZ
properties are listed in Table 5-124.
Table 5-124 OracleTimeStampTZ Properties
Properties | Description |
---|---|
BinData |
Returns an array of bytes that represents an Oracle TIMESTAMP WITH TIME ZONE in Oracle internal format |
Day |
Specifies the day component of an OracleTimeStampTZ in the current time zone |
IsNull |
Indicates whether the current instance has a null value |
Hour |
Specifies the hour component of an OracleTimeStampTZ in the current time zone |
Millisecond |
Specifies the millisecond component of an OracleTimeStampTZ in the current time zone |
Minute |
Specifies the minute component of an OracleTimeStampTZ in the current time zone |
Month |
Specifies the month component of an OracleTimeStampTZ in the current time zone |
Nanosecond |
Specifies the nanosecond component of an OracleTimeStampTZ in the current time zone |
Second |
Specifies the second component of an OracleTimeStampTZ in the current time zone |
TimeZone |
Returns the time zone of the OracleTimeStampTZ instance |
Value |
Returns the date and time that is stored in the OracleTimeStampTZ structure in the current time zone |
Year |
Specifies the year component of an OracleTimeStampTZ |
This property returns an array of bytes that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
// C# public byte[] BinData {get;}
The provided byte array that represents an Oracle TIMESTAMP
WITH
TIME
ZONE
in Oracle internal format.
OracleNullValueException
- The current instance has a null value.
This property specifies the day component of an OracleTimeStampTZ
in the current time zone.
// C# public int Day{get;}
A number that represents the day. Range of Day
is (1 to 31).
OracleNullValueException
- The current instance has a null value.
This property indicates whether the current instance has a null value.
// C# public bool IsNull{get;}
Returns true
if the current instance has a null value. Otherwise, returns false
.
This property specifies the hour component of an OracleTimeStampTZ
in the current time zone.
// C# public int Hour{get;}
A number that represents the hour. Range of Hour
is (0 to 23).
OracleNullValueException
- The current instance has a null value.
This property gets the millisecond component of an OracleTimeStampTZ
in the current time zone.
// C# public double Millisecond{get;}
A number that represents a millisecond. Range of Millisecond
is (0 to 999.999999)
OracleNullValueException
- The current instance has a null value.
This property gets the minute component of an OracleTimeStampTZ
in the current time zone.
// C# public int Minute{get;}
A number that represent a minute. Range of Minute
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property gets the month component of an OracleTimeStampTZ
in the current time zone
// C# public int Month{get;}
A number that represents a month. Range of Month
is (1 to 12).
OracleNullValueException
- The current instance has a null value.
This property gets the nanosecond component of an OracleTimeStampTZ
in the current time zone.
// C# public int Nanosecond{get;}
A number that represents a nanosecond. Range of Nanosecond
is (0 to 999999999).
OracleNullValueException
- The current instance has a null value.
This property gets the second component of an OracleTimeStampTZ
in the current time zone.
// C# public int Second{get;}
A number that represents a second. Range of Second
is (0 to 59).
OracleNullValueException
- The current instance has a null value.
This property returns the time zone of the OracleTimeStampTZ
instance.
// C# public string TimeZone{get;}
A string that represents the time zone.
If no time zone is specified in the constructor, this property is set to the thread's OracleGlobalization
.TimeZone
by default
This property returns the date and time that is stored in the OracleTimeStampTZ
structure in the current time zone.
// C# public DateTime Value{get;}
A DateTime
in the current time zone.
OracleNullValueException
- The current instance has a null value.
This property sets the year component of an OracleTimeStampTZ
in the current time zone.
// C# public int Year{get;}
A number that represents a year. The range of Year
is (-4712 to 9999).
OracleNullValueException
- The current instance has a null value.
The OracleTimeStampTZ
methods are listed in Table 5-125.
Table 5-125 OracleTimeStampTZ Methods
Methods | Description |
---|---|
AddDays |
Adds the supplied number of days to the current instance |
AddHours |
Adds the supplied number of hours to the current instance |
AddMilliseconds |
Adds the supplied number of milliseconds to the current instance |
AddMinutes |
Adds the supplied number of minutes to the current instance |
AddMonths |
Adds the supplied number of months to the current instance |
AddNanoseconds | Adds the supplied number of nanoseconds to the current instance |
AddSeconds | Adds the supplied number of seconds to the current instance |
AddYears |
Adds the supplied number of years to the current instance |
CompareTo |
Compares the current OracleTimeStampTZ instance to an object, and returns an integer that represents their relative values |
Equals |
Determines whether an object has the same date and time as the current OracleTimeStampTZ instance (Overloaded) |
GetDaysBetween |
Subtracts an OracleTimeStampTZ from the current instance and returns an OracleIntervalDS that represents the time interval |
GetHashCode |
Returns a hash code for the OracleTimeStampTZ instance |
GetTimeZoneOffset |
Gets the time zone information in hours and minutes of the current OracleTimeStampTZ |
GetYearsBetween |
Subtracts an OracleTimeStampTZ from the current instance and returns an OracleIntervalYM that represents the time interval |
GetType | Inherited from Object |
ToLocalTime |
Converts the current OracleTimeStampTZ instance to local time |
ToOracleDate |
Converts the current OracleTimeStampTZ structure to an OracleDate structure |
ToOracleTimeStampLTZ |
Converts the current OracleTimeStampTZ structure to an OracleTimeStampLTZ structure |
ToOracleTimeStamp |
Converts the current OracleTimeStampTZ structure to an OracleTimeStamp structure |
ToString |
Converts the current OracleTimeStampTZ structure to a string |
ToUniversalTime |
Converts the current datetime to Coordinated Universal Time (UTC) |
This method adds the supplied number of days to the current instance.
// C# public OracleTimeStampTZ AddDays(double days);
days
The supplied number of days. Range is (-1,000,000,000 < days
< 1,000,000,000)
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of hours to the current instance.
// C# public OracleTimeStampTZ AddHours(double hours);
hours
The supplied number of hours. Range is (-24,000,000,000 < hours
< 24,000,000,000).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of milliseconds to the current instance.
// C# public OracleTimeStampTZ AddMilliseconds(double milliseconds);
milliseconds
The supplied number of milliseconds. Range is (-8.64 * 1016< milliseconds
< 8.64 * 1016).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of minutes to the current instance.
// C# public OracleTimeStampTZ AddMinutes(double minutes);
minutes
The supplied number of minutes. Range is (-1,440,000,000,000 < minutes
< 1,440,000,000,000).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of months to the current instance.
// C# public OracleTimeStampTZ AddMonths(long months);
months
The supplied number of months. Range is (-12,000,000,000 < months
< 12,000,000,000).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of nanoseconds to the current instance.
// C# public OracleTimeStampTZ AddNanoseconds(long nanoseconds);
nanoseconds
The supplied number of nanoseconds.
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
This method adds the supplied number of seconds to the current instance.
// C# public OracleTimeStampTZ AddSeconds(double seconds);
seconds
The supplied number of seconds. Range is (-8.64 * 1013< seconds
< 8.64 * 1013).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method adds the supplied number of years to the current instance
// C# public OracleTimeStampTZ AddYears(int years);
years
The supplied number of years. Range is (-999,999,999 <= years
< = 999,999,999).
An OracleTimeStampTZ
.
OracleNullValueException
- The current instance has a null value.
ArgumentOutofRangeException
- The argument value is out of the specified range.
This method compares the current OracleTimeStampTZ
instance to an object, and returns an integer that represents their relative values.
// C# public int CompareTo(object obj);
obj
The object being compared to the current OracleTimeStampTZ
instance.
The method returns a number that is:
Less than zero: if the current OracleTimeStampTZ
instance value is less than that of obj
.
Zero: if the current OracleTimeStampTZ
instance and obj
values are equal.
Greater than zero: if the current OracleTimeStampTZ
instance value is greater than that of obj
.
IComparable
ArgumentException
- The obj
is not of type OracleTimeStampTZ
.
The following rules apply to the behavior of this method.
The comparison must be between OracleTimeStampTZ
s. For example, comparing an OracleTimeStampTZ
instance with an OracleBinary
instance is not allowed. When an OracleTimeStampTZ
is compared with a different type, an ArgumentException
is thrown.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
Overrides Object
This method determines whether an object has the same date and time as the current OracleTimeStampTZ
instance.
// C# public override bool Equals(object obj);
obj
The object being compared to the current OracleTimeStampTZ
instance.
Returns true
if the obj
is of type OracleTimeStampTZ
and represents the same date and time; otherwise, returns false
.
The following rules apply to the behavior of this method.
Any OracleTimeStampTZ
that has a value is greater than an OracleTimeStampTZ
that has a null value.
Two OracleTimeStampTZ
s that contain a null value are equal.
This method subtracts an OracleTimeStampTZ
value from the current instance and returns an OracleIntervalDS
that represents the time interval.
// C# public OracleIntervalDS GetDaysBetween(OracleTimeStampTZ value1);
value1
The OracleTimeStampTZ
value being subtracted.
An OracleIntervalDS
that represents the interval between two OracleTimeStampTZ
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalDS
has a null value.
Overrides Object
This method returns a hash code for the OracleTimeStampTZ
instance.
// C# public override int GetHashCode();
A number that represents the hash code.
This method gets the time zone portion in hours and minutes of the current OracleTimeStampTZ
.
// C# public TimeSpan GetTimeZoneOffset();
A TimeSpan
.
OracleNullValueException
- The current instance has a null value.
This method subtracts an OracleTimeStampTZ
value from the current instance and returns an OracleIntervalYM
that represents the time interval.
// C# public OracleIntervalYM GetYearsBetween(OracleTimeStampTZ val);
val
The OracleTimeStampTZ
value being subtracted.
An OracleIntervalYM
that represents the interval between two OracleTimeStampTZ
values.
If either the current instance or the parameter has a null value, the returned OracleIntervalYM
has a null value.
This method converts the current OracleTimeStampTZ
instance to local time.
// C# public OracleTimeStampLTZ ToLocalTime();
An OracleTimeStampLTZ
that contains the date and time, which is normalized to the client local time zone, in the current instance.
If the current instance has a null value, the returned OracleTimeStampLTZ
has a null value.
This method converts the current OracleTimeStampTZ
structure to an OracleDate
structure.
// C# public OracleDate ToOracleDate();
The returned OracleDate
contains the date and time in the current instance, but the time zone information in the current instance is truncated
The precision of the OracleTimeStampTZ
value can be lost during the conversion, and the time zone information in the current instance is truncated.
If the current instance has a null value, the value of the returned OracleDate
structure has a null value.
This method converts the current OracleTimeStampTZ
structure to an OracleTimeStampLTZ
structure.
// C# public OracleTimeStampLTZ ToOracleTimeStampLTZ();
The returned OracleTimeStampLTZ
structure contains the date and time, which is normalized to the client local time zone, in the current instance.
If the value of the current instance has a null value, the value of the returned OracleTimeStampLTZ
structure has a null value.
This method converts the current OracleTimeStampTZ
structure to an OracleTimeStamp
structure.
// C# public OracleTimeStamp ToOracleTimeStamp();
The returned OracleTimeStamp
contains the date and time in the current instance, but the time zone information is truncated.
If the value of the current instance has a null value, the value of the returned OracleTimeStamp
structure has a null value.
Overrides Object
This method converts the current OracleTimeStampTZ
structure to a string.
// C# public override string ToString();
A string
that represents the same date and time as the current OracleTimeStampTZ
structure.
The returned value is a string representation of an OracleTimeStampTZ
in the format specified by the OracleGlobalization
.TimeStampTZFormat
property of the thread. The names and abbreviations used for months and days are in the language specified by the OracleGlobalization
.DateLanguage
and the OracleGlobalization.Calendar
properties of the thread. If any of the thread's globalization properties are set to null or an empty string, the client computer's settings are used.
// C# // Set the nls_timestamp_tz_format for the TimeStampTZFormat(string) constructor OracleGlobalization og = OracleGlobalization.GetClientInfo(); og.TimeStampTZFormat = "DD-MON-YYYY HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); // construct OracleTimeStampTZ from a string using the format specified. OracleTimeStampTZ tstz = new OracleTimeStampTZ("11-NOV-1999" + "11:02:33.444 AM US/Pacific"); // Set the nls_timestamp_tz_format for the ToString() method og.TimeStampTZFormat = "YYYY-MON-DD HH:MI:SS.FF AM TZR"; OracleGlobalization.SetThreadInfo(og); Console.WriteLine(tstz.ToString()); // Prints "1999-NOV-11 11:02:33.444000000 AM US/Pacific"
This method converts the current datetime to Coordinated Universal Time (UTC).
// C# public OracleTimeStampTZ ToUniversalTime();
An OracleTimeStampTZ
structure.
If the current instance has a null value, the value of the returned OracleTimeStampTZ
structure has a null value.