IBM PureData® System for Analytics (Netezza) and Db2 query compatibility

Although Netezza® and Db2® queries are generally compatible, you should be aware of certain differences in support.

Following are some of the differences:
Intervals
In a Db2 query, you can use a labeled duration. A labeled duration represents a specific unit of time as expressed by a number (which can be the result of an expression) followed by a duration keyword, such as YEARS, MONTHS, or DAYS. For example, 2 MONTHS is a labeled duration.
Consider the following Netezza examples:

select current_timestamp + INTERVAL '1 DAY' FROM FOO
SELECT CURRENT_TIMESTAMP + INTERVAL('1 DAY') FROM FOO
The equivalent Db2 example is as follows:
SELECT current_timestamp + 1 DAY FROM FOO
Isolation levels
A Netezza query supports serializable transaction isolation. A Db2 query supports the following isolation levels:
  • The repeatable read (RR) isolation level, for row-organized tables only
  • The read stability (RS) isolation level, for row-organized tables only
  • The cursor stability (CS) isolation level
  • The uncommitted read (UR) isolation level
SELECT statements without FROM clauses
In a Db2 query, the FROM clause is mandatory. For example, the following SELECT statement is not supported:
SELECT constant as
alias;
If you are referencing a value, use the VALUES statement or use FROM sysibm.sysdummy1 as. If you are invoking a procedure, use the CALL statement.

For more details about differences between Netezza and Db2 DML, see IBM PureData System for Analytics (Netezza) and Db2 SQL compatibility.

You can use the Db2 SQL_COMPAT global variable to enable certain Netezza behavior that is not supported by default in a Db2 system. For information, see Compatibility features for Netezza Platform Software (NPS®).