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.
Class Inheritance
Object
ValueType
OracleIntervalDS
Declaration
// C# public struct OracleIntervalDS : IComparable
Thread Safety
All public static methods are thread-safe, although instance methods do not guarantee thread safety.
Example
// C# using System; using Oracle.DataAccess.Types; class OracleIntervalDSSample { static void Main() { OracleIntervalDS iDSMax = OracleIntervalDS.MaxValue; double totalDays = iDSMax.TotalDays; totalDays -= 1; OracleIntervalDS iDSMax_1 = new OracleIntervalDS(totalDays); // Calculate the difference OracleIntervalDS iDSDiff = iDSMax - iDSMax_1; // Prints "iDSDiff.ToString() = +000000000 23:59:59.999999999" Console.WriteLine("iDSDiff.ToString() = " + iDSDiff.ToString()); } }
Requirements
Namespace: Oracle.DataAccess.Types
Assembly: Oracle.DataAccess.dll
OracleIntervalDS
members are listed in the following tables:
OracleIntervalDS Constructors
OracleIntervalDS
constructors are listed in Table 11-48
Table 11-48 OracleIntervalDS Constructors
Constructor | Description |
---|---|
OracleIntervalDS Constructors | Instantiates a new instance of OracleIntervalDS structure (Overloaded) |
OracleIntervalDS Static Fields
The OracleIntervalDS
static fields are listed in Table 11-49.
Table 11-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 |
OracleIntervalDS Static Methods
The OracleIntervalDS
static methods are listed in Table 11-50.
Table 11-50 OracleIntervalDS Static Methods
Methods | Description |
---|---|
Equals | Determines whether or not two OracleIntervalDS values are equal (Overloaded) |
GreaterThan | Determines whether or not one OracleIntervalDS value is greater than another |
GreaterThanOrEqual | Determines whether or not one OracleIntervalDS value is greater than or equal to another |
LessThan | Determines whether or not one OracleIntervalDS value is less than another |
LessThanOrEqual | Determines whether or not one OracleIntervalDS value is less than or equal to another |
NotEquals | Determines whether or not 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 |
OracleIntervalDS Static Operators
The OracleIntervalDS
static operators are listed in Table 11-51.
Table 11-51 OracleIntervalDS Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalDS values |
operator == | Determines whether or not two OracleIntervalDS values are equal |
operator > | Determines whether or not one OracleIntervalDS value is greater than another |
operator >= | Determines whether or not one OracleIntervalDS value is greater than or equal to another |
operator != | Determines whether or not two OracleIntervalDS values are not equal |
operator < | Determines whether or not one OracleIntervalDS value is less than another |
operator <= | Determines whether or not 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 |
OracleIntervalDS Type Conversions
The OracleIntervalDS
type conversions are listed in Table 11-52.
Table 11-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 |
OracleIntervalDS Properties
The OracleIntervalDS
properties are listed in Table 11-53.
Table 11-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 or not 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 |
OracleIntervalDS Methods
The OracleIntervalDS
methods are listed in Table 11-54.
Table 11-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 or not 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.
Overload List:
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.
Declaration
// C#
public OracleIntervalDS(TimeSpan ts);
Parameters
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.
Declaration
// C#
public OracleIntervalDS(string intervalStr);
Parameters
intervalStr
A string representing the Oracle INTERVAL
DAY
TO
SECOND
.
Exceptions
ArgumentException
- The intervalStr
parameter is not in the valid format or has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
Remarks
The value specified in the supplied intervalStr
must be in Day HH:MI:SSxFF format.
Example
"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.
Declaration
// C#
public OracleIntervalDS(double totalDays);
Parameters
totalDays
The supplied total number of days for a time interval. Range of days is -1000,000,000 < totalDays
< 1000,000,000.
Exceptions
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.
Declaration
// C# public OracleIntervalDS (int days, int hours, int minutes, int seconds, double milliSeconds);
Parameters
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).
Exceptions
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
.
Remarks
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.
Declaration
// C# public OracleIntervalDS (int days, int hours, int minutes, int seconds, int nanoseconds);
Parameters
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)
Exceptions
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
.
Remarks
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.
Declaration
// C#
public OracleIntervalDS (byte[ ] bytes);
Parameters
bytes
A byte array that is in an internal Oracle INTERVAL
DAY
TO
SECOND
format.
Exceptions
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 11-55.
Table 11-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.
Declaration
// C# public static readonly OracleIntervalDS MaxValue;
Remarks
Maximum values:
Day: 999999999
hour: 23
minute is 59
second: 59
nanosecond: 999999999
This static field represents the minimum value for an OracleIntervalDS
structure.
Declaration
// C# public static readonly OracleIntervalDS MinValue;
Remarks
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.
Declaration
// C# public static readonly OracleIntervalDS Null;
This static field represents a zero value for an OracleIntervalDS
structure.
Declaration
// C# public static readonly OracleIntervalDS Zero;
The OracleIntervalDS
static methods are listed in Table 11-56.
Table 11-56 OracleIntervalDS Static Methods
Methods | Description |
---|---|
Equals | Determines whether or not two OracleIntervalDS values are equal (Overloaded) |
GreaterThan | Determines whether or not one OracleIntervalDS value is greater than another |
GreaterThanOrEqual | Determines whether or not one OracleIntervalDS value is greater than or equal to another |
LessThan | Determines whether or not one OracleIntervalDS value is less than another |
LessThanOrEqual | Determines whether or not one OracleIntervalDS value is less than or equal to another |
NotEquals | Determines whether or not 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 or not two OracleIntervalDS
values are equal.
Declaration
// C# public static bool Equals(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
If the two OracleIntervalDS
structures represent the same time interval, returns true
; otherwise, returns false
.
Remarks
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 or not the first of two OracleIntervalDS
values is greater than the second.
Declaration
// C# public static bool GreaterThan(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is greater than the second; otherwise, returns false
.
Remarks
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 or not the first of two OracleIntervalDS
values is greater than or equal to the second.
Declaration
// C# public static bool GreaterThanOrEqual(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is greater than or equal to the second; otherwise, returns false
.
Remarks
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 or not the first of two OracleIntervalDS
values is less than the second.
Declaration
// C# public static bool LessThan(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is less than the second; otherwise, returns false
.
Remarks
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 or not the first of two OracleIntervalDS
values is less than or equal to the second.
Declaration
// C# public static bool LessThanOrEqual(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is less than or equal to the second; otherwise, returns false
.
Remarks
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 or not two OracleIntervalDS
values are not equal.
Declaration
// C# public static bool NotEquals(OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if two OracleIntervalDS
values are not equal; otherwise, returns false
.
Remarks
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.
Declaration
// C#
public static OracleIntervalDS Parse(string intervalStr);
Parameters
intervalStr
A string representing the Oracle INTERVAL
DAY
TO
SECOND
.
Return Value
Returns an OracleIntervalDS
instance representing the time interval from the supplied string.
Exceptions
ArgumentException
- The intervalStr
parameter is not in the valid format or intervalStr
has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
Remarks
The value specified in intervalStr
must be in Day HH:MI:SSxFF format.
Example
"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.
Declaration
// C# public static OracleIntervalDS SetPrecision(OracleIntervalDS value1, int dayPrecision, int fracSecPrecision);
Parameters
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).
Return Value
An OracleIntervalDS
instance.
Exceptions
ArgumentOutOfRangeException
- An argument value is out of the specified range.
Remarks
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()
.
Example
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 11-57.
Table 11-57 OracleIntervalDS Static Operators
Operator | Description |
---|---|
operator + | Adds two OracleIntervalDS values |
operator == | Determines whether or not two OracleIntervalDS values are equal |
operator > | Determines whether or not one OracleIntervalDS value is greater than another |
operator >= | Determines whether or not one OracleIntervalDS value is greater than or equal to another |
operator != | Determines whether or not two OracleIntervalDS values are not equal |
operator < | Determines whether or not one OracleIntervalDS value is less than another |
operator <= | Determines whether or not 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.
Declaration
// C# public static OracleIntervalDS operator + (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
An OracleIntervalDS.
Remarks
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.
Declaration
// C# public static bool operator == (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the two OracleIntervalDS
values are the same; otherwise returns false
.
Remarks
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.
Declaration
// C# public static bool operator > (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if one OracleIntervalDS
value is greater than another; otherwise, returns false
.
Remarks
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.
Declaration
// C# public static bool operator >= (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is greater than or equal to the second; otherwise, returns false
.
Remarks
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.
Declaration
// C# public static bool operator != (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the two OracleIntervalDS
values are not equal; otherwise, returns false
.
Remarks
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.
Declaration
// C# public static bool operator < (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is less than the second; otherwise, returns false
.
Remarks
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.
Declaration
// C# public static bool operator <= (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
Returns true
if the first of two OracleIntervalDS
values is less than or equal to the second; otherwise, returns false
.
Remarks
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.
Declaration
// C# public static OracleIntervalDS operator - (OracleIntervalDS val1, OracleIntervalDS val2);
Parameters
val1
The first OracleIntervalDS
.
val2
The second OracleIntervalDS
.
Return Value
An OracleIntervalDS
structure.
Remarks
If either argument has a null value, the returned OracleIntervalDS
structure has a null value.
This static operator negates the supplied OracleIntervalDS
structure.
Declaration
// C#
public static OracleIntervalDS operator - (OracleIntervalDS val);
Parameters
val
An OracleIntervalDS
.
Return Value
An OracleIntervalDS
structure.
Remarks
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.
Declaration
// C#
public static OracleIntervalDS operator * (OracleIntervalDS val1,
int multiplier);
Parameters
val1
The first OracleIntervalDS
.
multiplier
A multiplier.
Return Value
A new OracleIntervalDS
instance.
Remarks
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.
Declaration
// C# public static OracleIntervalDS operator / (OracleIntervalDS val1, int divisor);
Parameters
val1
The first OracleIntervalDS
.
divisor
A divisor.
Return Value
An OracleIntervalDS
structure.
Remarks
If the OracleIntervalDS
structure has a null value, the returned OracleIntervalDS
structure has a null value.
The OracleIntervalDS
type conversions are listed in Table 11-58.
Table 11-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.
Declaration
// C#
public static explicit operator TimeSpan(OracleIntervalDS val);
Parameters
val
An OracleIntervalDS
instance.
Return Value
A TimeSpan
structure.
Exceptions
OracleNullValueException
- The OracleIntervalDS
structure has a null value.
Remarks
This type conversion operator converts a string to an OracleIntervalDS
structure.
Declaration
// C#
public static explicit operator OracleIntervalDS (string intervalStr);
Parameters
intervalStr
A string representation of an Oracle INTERVAL
DAY
TO
SECOND
.
Return Value
An OracleIntervalDS
structure.
Exceptions
ArgumentException
- The supplied intervalStr
parameter is not in the correct format or has an invalid value.
ArgumentNullException
- The intervalStr
parameter is null.
Remarks
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.
Example
"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.
Declaration
// C#
public static implicit operator OracleIntervalDS(TimeSpan val);
Parameters
val
A TimeSpan
instance.
Return Value
An OracleIntervalDS
structure.
Remarks
The returned OracleIntervalDS
structure contains the same days, hours, seconds, and milliseconds as the supplied TimeSpan
val
.
The OracleIntervalDS
properties are listed in Table 11-59.
Table 11-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 or not 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.
Declaration
// C# public byte[] BinData {get;}
Property Value
A byte array that represents an Oracle INTERVAL
DAY
TO
SECOND
in Oracle internal format.
Exceptions
OracleNullValueException
- The current instance has a null value.
Remarks
This property gets the days component of an OracleIntervalDS
.
Declaration
// C# public int Days {get;}
Property Value
An int
representing the days component.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property gets the hours component of an OracleIntervalDS.
Declaration
// C# public int Hours {get;}
Property Value
An int
representing the hours component.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property indicates whether or not the current instance has a null value.
Declaration
// C# public bool IsNull {get;}
Property Value
Returns true
if the current instance has a null value; otherwise, returns false
.
This property gets the milliseconds component of an OracleIntervalDS.
Declaration
// C# public double Milliseconds {get;}
Property Value
A double
that represents milliseconds component.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property gets the minutes component of an OracleIntervalDS.
Declaration
// C# public int Minutes {get;}
Property Value
A int
that represents minutes component.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property gets the nanoseconds component of an OracleIntervalDS
.
Declaration
// C# public int Nanoseconds {get;}
Property Value
An int
that represents nanoseconds component.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property gets the seconds component of an OracleIntervalDS.
Declaration
// C# public int Seconds {get;}
Property Value
An int
that represents seconds component.
Exceptions
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.
Declaration
// C# public double TotalDays {get;}
Property Value
A double
that represents the total number of days.
Exceptions
OracleNullValueException
- The current instance has a null value.
This property specifies the time interval that is stored in the OracleIntervalDS
structure.
Declaration
// C# public TimeSpan Value {get;}
Property Value
A time interval.
Exceptions
OracleNullValueException
- The current instance has a null value.
The OracleIntervalDS
methods are listed in Table 11-60.
Table 11-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 or not 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.
Declaration
// C#
public int CompareTo(object obj);
Parameters
obj
The object being compared to.
Return Value
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
.
Implements
IComparable
Exceptions
ArgumentException
- The obj
parameter is not of type OracleIntervalDS
.
Remarks
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 or not the specified object
has the same time interval as the current instance.
Declaration
// C#
public override bool Equals(object obj);
Parameters
obj
The specified object.
Return Value
Returns true
if obj
is of type OracleIntervalDS
and has the same time interval as the current instance; otherwise, returns false
.
Remarks
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.
Declaration
// C# public override int GetHashCode();
Overrides Object
This method converts the current OracleIntervalDS
structure to a string.
Declaration
// C# public override string ToString();
Return Value
Returns a string
.
Remarks
If the current instance has a null value, the returned string contains "null".