Public member functions documentation

NzaeTimestampField addTime(const NzaeTimeField &time) const
Constructs a TimestampField by adding time.
Parameters
NzaeTimeField time

The NzaeTimeField value.

Returns
NzaeTimestampField

The timestamp consisting of date plus time.

See also: NzaeTimeField, NzaeTimestampField.

NzaeTimestampField addTimeTz(const NzaeTimeTzField &time) const
Constructs a TimestampField by adding timetz.
Parameters
NzaeTimeField time

The NzaeTimeField value.

Returns
NzaeTimestampField

The timestamp consisting of date plus timetz.

See also: NzaeTimeField, NzaeTimestampField.

NzaeIntervalField age(const NzaeDateField &x) const
Constructs an IntervalField by subtracting dates.
Parameters
NzaeTimeField x

The NzaeTimeField value.

Returns
NzaeIntervalField
IntervalField consisting of date minus date.

See also: NzaeIntervalField.

void decodeDate(uint8_t *month, uint8_t *day, uint16_t *year, bool *errorFlag=NULL) const
Converts a Netezza-encoded Date value to m/d/y.
Parameters
day
The day count, 1 to 31 inclusive.
month
The month number, 1 to 12 inclusive.
year
The year number, SQL_YEAR_MIN to SQL_YEAR_MAX inclusive.
errorFlag
If not NULL, *set to TRUE if isValidDate(encodedDate) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
void decodeDate(time_t *result, bool *errorFlag=NULL) const
Converts a Netezza-encoded Date value to time_t and treats encoded date as if it is UTC. The resulting time_t represents the time 00:00:00 on the specified date.
Parameters
result
The time_t date representation. Forced to be signed int32.
errorFlag
If not NULL, *set to TRUE if isValidDate(encodedDate) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
void decodeDate(struct tm *result, bool *errorFlag=NULL) const
Converts a Netezza-encoded Date value to struct tm. The resulting tm represents the time 00:00:00 on the specified date, with an unknown daylight saving time status.
Parameters
result
The structure where the decoded Date is written, such that result->tm_year, result->tm_mon, result-> tm_mday, result->tm_yday and result->tm_wday contain the appropriate fields in tm format. result->tm_isdst is set to -1. When applicable, all the other fields of result are set to 0.
errorFlag
If not NULL, *set to TRUE if isValidDate(encodedDate) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
void encodeDate(uint32_t month, uint32_t day, uint32_t year, bool *errorFlag=NULL)
Converts a m/d/y Date value to a Netezza-encoded Date.
Parameters
day
The day count, 1 to 31 inclusive.
month
The month number, 1 to 12 inclusive.
year
The year number, SQL_YEAR_MIN to SQL_YEAR_MAX inclusive.
errorFlag
If not NULL, *set to TRUE if isValidDate(encodedDate) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
void encodeDate(time_t date, bool *errorFlag=NULL)
Converts a time_t Date value to a Netezza-encoded Date. Drops the hours, minutes and seconds elapsed after the last whole day in the time_t value.
Parameters
date
The time_t date value.
errorFlag
If not NULL, *set to TRUE if isValidDate(encodedDate) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
void encodeDate(const struct tm &date, bool *errorFlag=NULL)
Converts a struct tm value to a Netezza-encoded Date. Uses only the tm.tm_year, tm.tm_mon and tm.tm_day fields of the date, ignoring the other fields. It is recommended that the date passes isValidTimeStruct(), but it is not required.
void fromString(std::string str)
Constructs the field from the string.
Parameters
date
The time_t date value.
errorFlag
If not NULL, *set to TRUE if date.tm_mon<0 or date.tm_mday<1 or date.tm_year+1900<SQL_YEAR_MIN or isValidDate(date.tm_mon+1, date.tm_mday, date.tm_year) is FALSE; *set to FALSE otherwise.
Exceptions: NzaeException
bool isValidDate() const

Specifies whether a Netezza-encoded Date value is valid and within the Netezza Date range.

Parameters
str
The string to assign from.
bool isValidEpochDate() const
Specifies whether a Netezza-encoded Date value is valid and within the time_t Epoch range.
Returns
FALSE if encoded date<ENC_DATE_MIN or encoded date>ENC_DATE_MAX. TRUE otherwise.
NzaeDateField()
Constructs a NULL date field.
Returns
FALSE if encoded date< EPOCH_START_AS_DATE or encoded date> EPOCH_END_AS_DATE. TRUE otherwise.
NzaeDateField(const NzaeDateField &field)
Constructs a date field with value field.
NzaeDateField(const NzaeTimestampField &field)
Constructs a date field with value field.
Parameters
NzaeDateField field
The NzaeDateField value.
NzaeDateField(int32_t val)
Constructs a date field with value val.
Parameters
NzaeTimestampField field

The NzaeTimestampField value.

operator int32_t() const
Returns an encoded field value.
Parameters
val
The encoded date value.
operator NzaeTimestampField() const
Returns a timestamp field value.
Returns
The encoded value.
NzaeDateField& operator=(int32_t val)
Assigns the value of the argument to a field object
Returns
The timestamp value converted from date.
See also: NzaeTimestampField
NzaeDateField& operator=(const NzaeTimestampField &field)
Assigns the value of the argument to a field object.
Parameters
val
The encoded value to assign.
Returns
NzaeDateField
NzaeDateField& operator=(NzaeField &field)
Assigns the value of the argument to a field object.
Parameters
NzaeField field
The field to assign.
Returns
NzaeDateField
The field argument may be a different type, as long as it is compatible.
NzaeDateField& operator=(const NzaeDateField &field)
Assigns the value of the argument to a field object.
Parameters
NzaeDateField field
The field to assign.
Returns
NzaeDateField
std::string toString() const
Returns the string representation of the field.
Retruns
The string representation.
virtual NzaeDataTypes::Types type() const
Returns the type of the field.
Returns
Types
The field type.