The offsetTimestamp() function

Applies an offset [SQL_OFFSET_MIN, SQL_OFFSET_MAX] to a Netezza Performance Server Timestamp value.

Description

The function has the following syntax:
inline int64 (int64 nzTimestamp, int32 sqlOffset, bool* errorFlag = 
NULL)

nzTimestamp specifies a value in Netezza Performance Server Timestamp format.

sqlOffset specifies the time that is offset in minutes in the range of SQL_OFFSET_MIN to SQL_OFFSET_MAX, inclusive.

errorFlag is an optional argument. If not NULL, it is set to true if isValidSqlOffset(sqlOffset) is false, or isValidTimestamp(nzTimestamp) is false or isValidTimestamp(nzTimestamp+sqlOffset*60*1,000,000) is false. Otherwise, it is set to false.

Returns

ts=nzTimestamp + sqlOffset*60*1,000,000, if *errorFlag is NULL and an exception is not thrown or if *errorFlag is not NULL and, after the call, *errorFlag is false.

Otherwise, the function returns an indeterminate value.

Throws

The function throws an opaque exception object if errorFlag is NULL and (isValidSqlOffset(sqlOffset) is false, or isValidTimestamp(nzTimestamp) is false or isValidTimestamp(nzTimestamp+sqlOffset*60*1,000,000) is false).