| OCILIB (C and C++ Driver for Oracle)
    4.6.3
    | 
Object identifying the SQL data type INTERVAL. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Interval *>, and ocilib::Streamable.
| Public Types | |
| enum | IntervalTypeValues { YearMonth = OCI_INTERVAL_YM, DaySecond = OCI_INTERVAL_DS } | 
| Interval types enumerated values.  More... | |
| typedef Enum< IntervalTypeValues > | IntervalType | 
| Interval types.  More... | |
| Public Member Functions | |
| Interval () | |
| Create an empty null Interval instance. | |
| Interval (IntervalType type) | |
| Create a new instance of the given type.  More... | |
| Interval (IntervalType type, const ostring &data) | |
| Create an interval object with the value provided by the input interval string.  More... | |
| IntervalType | GetType () const | 
| Return the type of the given interval object. | |
| bool | IsValid () const | 
| Check if the given interval is valid. | |
| int | GetYear () const | 
| Return the interval year value.  More... | |
| void | SetYear (int value) | 
| Set the interval year value.  More... | |
| int | GetMonth () const | 
| Return the interval month value.  More... | |
| void | SetMonth (int value) | 
| Set the interval month value.  More... | |
| int | GetDay () const | 
| Return the interval day value.  More... | |
| void | SetDay (int value) | 
| Set the interval day value.  More... | |
| int | GetHours () const | 
| Return the interval hours value.  More... | |
| void | SetHours (int value) | 
| Set the interval hours value.  More... | |
| int | GetMinutes () const | 
| Return the interval minutes value.  More... | |
| void | SetMinutes (int value) | 
| Set the interval minutes value.  More... | |
| int | GetSeconds () const | 
| Return the interval seconds value.  More... | |
| void | SetSeconds (int value) | 
| Set the interval seconds value.  More... | |
| int | GetMilliSeconds () const | 
| Return the interval seconds value. | |
| void | SetMilliSeconds (int value) | 
| Set the interval milliseconds value. | |
| void | GetDaySecond (int &day, int &hour, int &min, int &sec, int &fsec) const | 
| Extract the date / second parts from the interval value.  More... | |
| void | SetDaySecond (int day, int hour, int min, int sec, int fsec) | 
| Set the Day / Second parts.  More... | |
| void | GetYearMonth (int &year, int &month) const | 
| Extract the year / month parts from the interval value.  More... | |
| void | SetYearMonth (int year, int month) | 
| Set the Year / Month parts.  More... | |
| void | UpdateTimeZone (const ostring &timeZone) | 
| Update the interval value with the given time zone.  More... | |
| void | FromString (const ostring &data) | 
| Assign to the interval object the value provided by the input interval string.  More... | |
| ostring | ToString (int leadingPrecision, int fractionPrecision) const | 
| Convert the interval value to a string using the given precisions.  More... | |
| ostring | ToString () const override | 
| Convert the interval value to a string using the default precisions of 10. | |
| Interval | Clone () const | 
| Clone the current instance to a new one performing deep copy. | |
| Interval | operator+ (const Interval &other) const | 
| Return a new Interval holding the sum of the current Interval value and the given Interval value. | |
| Interval | operator- (const Interval &other) const | 
| Return a new Interval holding the difference of the current Interval value and the given Interval value. | |
| Interval & | operator+= (const Interval &other) | 
| Increment the current Value with the given Interval value. | |
| Interval & | operator-= (const Interval &other) | 
| Decrement the current Value with the given Interval value. | |
| bool | operator== (const Interval &other) const | 
| Indicates if the current Interval value is equal to the given Interval value. | |
| bool | operator!= (const Interval &other) const | 
| Indicates if the current Interval value is not equal the given Interval value. | |
| bool | operator> (const Interval &other) const | 
| Indicates if the current Interval value is superior to the given Interval value. | |
| bool | operator< (const Interval &other) const | 
| Indicates if the current Interval value is inferior to the given Interval value. | |
| bool | operator>= (const Interval &other) const | 
| Indicates if the current Interval value is superior or equal to the given Interval value. | |
| bool | operator<= (const Interval &other) const | 
| Indicates if the current Interval value is inferior or equal to the given Interval value. | |
Object identifying the SQL data type INTERVAL.
This class wraps the OCILIB object handle OCI_Interval and its related methods
Definition at line 3267 of file ocilib.hpp.
Interval types.
Possible values are Interval::IntervalTypeValues
Definition at line 3299 of file ocilib.hpp.
Interval types enumerated values.
| Enumerator | |
|---|---|
| YearMonth | Interval unit range is months -> years | 
| DaySecond | Interval unit range is seconds -> days | 
Definition at line 3284 of file ocilib.hpp.
| 
 | inline | 
Create a new instance of the given type.
| type | - Interval type to create | 
Definition at line 2398 of file ocilib_impl.hpp.
References ocilib::Check(), OCI_IntervalCreate(), and OCI_IntervalFree().
| 
 | inline | 
Create an interval object with the value provided by the input interval string.
| type | - Interval type to create | 
| data | - String interval | 
Definition at line 2403 of file ocilib_impl.hpp.
References ocilib::Check(), Interval(), OCI_IntervalCreate(), and OCI_IntervalFree().
| 
 | inline | 
Return the interval year value.
Definition at line 2439 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval year value.
Definition at line 2448 of file ocilib_impl.hpp.
| 
 | inline | 
Return the interval month value.
Definition at line 2456 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval month value.
Definition at line 2465 of file ocilib_impl.hpp.
| 
 | inline | 
Return the interval day value.
Definition at line 2473 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval day value.
Definition at line 2482 of file ocilib_impl.hpp.
Referenced by ocilib::Timestamp::operator+(), ocilib::Timestamp::operator+=(), ocilib::Timestamp::operator-(), and ocilib::Timestamp::operator-=().
| 
 | inline | 
Return the interval hours value.
Definition at line 2490 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval hours value.
Definition at line 2499 of file ocilib_impl.hpp.
| 
 | inline | 
Return the interval minutes value.
Definition at line 2507 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval minutes value.
Definition at line 2516 of file ocilib_impl.hpp.
| 
 | inline | 
Return the interval seconds value.
Definition at line 2524 of file ocilib_impl.hpp.
| 
 | inline | 
Set the interval seconds value.
Definition at line 2533 of file ocilib_impl.hpp.
| 
 | inline | 
Extract the date / second parts from the interval value.
| day | - Place holder for Day value | 
| hour | - Place holder for Hour value | 
| min | - Place holder for Minutes value | 
| sec | - Place holder for Seconds value | 
| fsec | - Place holder for Milliseconds value | 
Definition at line 2558 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalGetDaySecond().
| 
 | inline | 
Set the Day / Second parts.
| day | - Day value | 
| hour | - Hour value | 
| min | - Minutes value | 
| sec | - Seconds value | 
| fsec | - Milliseconds value | 
Definition at line 2563 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalSetDaySecond().
| 
 | inline | 
Extract the year / month parts from the interval value.
| year | - Place holder for year value | 
| month | - Place holder for month value | 
Definition at line 2568 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalGetYearMonth().
| 
 | inline | 
Set the Year / Month parts.
| year | - Year value | 
| month | - Month value | 
Definition at line 2572 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalSetYearMonth().
| 
 | inline | 
Update the interval value with the given time zone.
| timeZone | - Time zone name | 
Definition at line 2577 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalFromTimeZone().
| 
 | inline | 
Assign to the interval object the value provided by the input interval string.
| data | - String interval | 
Definition at line 2582 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IntervalFromText().
| 
 | inline | 
Convert the interval value to a string using the given precisions.
| leadingPrecision | - leading precision | 
| fractionPrecision | - fraction precision | 
Definition at line 2587 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeString(), and OCI_IntervalToText().