DB2 LUW SQL Functions Compared To Netezza SQL Functions SQL designed to use functions with DB2 LUW databases may need to be converted to work with Netezza databases or DBA's may have to develop user defined functions (UDFs) with names that correspond to DB2 LUW SQL function names in order to avoid having to convert the SQL. Here is a list of DB2 LUW functions that do not exist in Netezza. DB2 LUW SQL Functions ARRAY_AGG ARRAY_DELETE ARRAY_FIRST ARRAY_LAST ARRAY_NEXT ARRAY_PRIOR ATANH BASE_TABLE BITAND BITANDNOT BITNOT BITOR BITXOR BLOB CARDINALITY CEILING CLOB COALESCE COLLATION_KEY_BIT COMPARE_DECFLOAT CONCAT CORRELATION COSH COUNT_BIG COVARIANCE CURSOR_ROWCOUNT Composed by Mark Mulligan Page 1 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions DATAPARTITIONNUM DAY DAYNAME DAYOFWEEK DAYOFWEEK_ISO DAYOFYEAR DAYS DBCLOB DBPARTITIONNUM DEC DECFLOAT DECFLOAT_FORMAT DECODE DECRYPT_BIN DECRYPT_CHAR DEREF DIFFERENCE DIGITS DOUBLE DOUBLE_PRECISION EMPTY_BLOB EMPTY_CLOB EMPTY_DBCLOB ENCRYPT EVENT_MON_STATE EXTRACT GENERATE_UNIQUE GETHINT GRAPHIC GREATEST HASHEDVALUE Composed by Mark Mulligan Page 2 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions HOUR IDENTIFY_VAL_LOCAL JULIAN_DAY LCASE LEAST LEFT LOCATE LOCATE_IN_STRING LONG_VARCHAR LONG_VARGRAPHIC MAX_CARDINALITY MICROSECOND MIDNIGHT_SECONDS MINUTE MONTH MONTHNAME MULTIPLY_ALT NORMALIZE_DECFLOAT NULLIF NVL OCTET_LENGTH OVERLAY PARAMETER POSTR QUANTIZE QUARTER RAISE_ERROR RAND REAL REC2XML REPLACE RID Composed by Mark Mulligan Page 3 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions RID_BIT RIGHT ROUND_TIMESTAMP SECLABEL SECLABEL_BY_NAME SECLABEL_TO_CHAR SECOND SINH SOUNDEX SPACE STRIP SUBSTRB TABLE_NAME TABLE_SCHEMA TANH TIMESTAMP_FORMAT TIMESTAMP_ISO TIMESTAMPDIFF TO_CLOB TOTALORDER TRIM TRIM_ARRAY TRUNC_TIMESTAMP TRUNCATE TYPE_ID TYPE_NAME TYPE_SCHEMA UCASE UNNEST VALUE VARCHAR_FORMAT VARCHAR_FORMAT_BIT Composed by Mark Mulligan Page 4 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions VARGRAPHIC WEEK WEEK_ISO XMLAGG XMLATTRIBUTES XMLCOMMENT XMLCONCAT XMLDOCUMENT XMLELEMENT XMLFOREST XMLGROUP XMLNAMESPACES XMLPARSE XMLPI XMLQUERY XMLROW XMLSERIALIZE XMLTABLE XMLTEXT XMLVALIDATE XMLXSROBJECTID XSLTRANSFORM YEAR Here is a list of DB2 LUW functions that have different names in Netezza. It would be simple for a DBA to create a user defined function (UDF) in Netezza by the same name as the DB2 LUW function and use the Netezza function name in that passing it the same parameters so that SQL would not have to be converted if it used these functions. DB2 LUW SQL Functions _________________ Netezza SQL Functions BIGINT _________________________________ INT8 CHARACTER_LENGTH ___________________ CHAR_LENGTH DECIMAL _______________________________ NUMERIC Composed by Mark Mulligan Page 5 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions FLOAT _________________________________ FLOAT4 HEX ___________________________________ STRING_TO_HEX HEX ____________________________________ TO_HEX INT _____________________________________ INT4 INTEGER ________________________________ INT4 LOG10 __________________________________ DLOG10 POWER _________________________________ POW SMALLINT _______________________________ INT2 VARCHAR_BIT_FORMAT___________________ VARBINARY Here is a list of DB2 LUW functions that match Netezza functions by name. DB2 LUW SQL Functions Netezza Functions ABS ABS ACOS ACOS ADD_MONTHS ADD_MONTHS ASCII ASCII ASIN ASIN ATAN ATAN ATAN2 ATAN2 AVG AVG CEIL CEIL CHAR CHAR CHR CHR COS COS COT COT COUNT COUNT DATE DATE DEGREES DEGREES EXP EXP FLOAT FLOAT4 FLOOR FLOOR GROUPING GROUPING Composed by Mark Mulligan Page 6 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions INITCAP INITCAP INSTR INSTR LAST_DAY LAST_DAY LENGTH LENGTH LN LN LOWER LOWER LPAD LPAD LTRIM LTRIM MAX MAX MIN MIN MOD MOD MONTHS_BETWEEN MONTHS_BETWEEN NEXT_DAY NEXT_DAY POSITION POSITION RADIANS RADIANS REPEAT REPEAT ROUND ROUND RPAD RPAD RTRIM RTRIM SIGN SIGN SIN SIN SQRT SQRT STDDEV STDDEV SUBSTR SUBSTR SUBSTRING SUBSTRING SUM SUM TAN TAN TIME TIME TIMESTAMP TIMESTAMP TO_CHAR TO_CHAR TO_DATE TO_DATE Composed by Mark Mulligan Page 7 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions TO_NUMBER TO_NUMBER TO_TIMESTAMP TO_TIMESTAMP TRANSLATE TRANSLATE TRUNC TRUNC UPPER UPPER VARCHAR VARCHAR VARIANCE VARIANCE Here is a list of SQL functions that exist in Netezza but not in DB2 LUW. If SQL has to be converted to use DB2 LUW that uses these functions then either the SQL will have to be changed or DBAs will have to create user defined functions (UDFs) using these same names to avoid having to change SQL. Netezza SQL Functions AGE BITMAP_AGGR BOOL BPCHAR BTRIM CHARCODES COMBINE_LABEL CUME_DIST CURRENT_CATALOG CURRENT_DBID CURRENT_PATH CURRENT_SCHEMA CURRENT_SCHEMAID CURRENT_SID CURRENT_TX_PATH CURRENT_TX_SCHEMA CURRENT_TX_SCHEMAID CURRENT_USER CURRENT_USERID CURRENT_USEROID DATE_PART Composed by Mark Mulligan Page 8 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions DATE_TRUNC DB_ENCODING DBL_MP DCEIL DEFAULT_SCHEMA DEFAULT_SCHEMAID DENSE_RANK DEXP DFLOOR DLE_DST DLOG1 DPOW DROUND DSQRT DTRUNC FACTORIAL FIRST_VALUE FLOAT8 FPOW GETDATABASEENCODING IDENTIFIER_CASE INT_MONTHS_BETWEEN INT1 INTERVAL ISFALSE ISNOTFALSE ISNOTTRUE ISTRUE LAG LAST_VALUE LE_DST LEAD LOG Composed by Mark Mulligan Page 9 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions MAX_LABEL NAME NCHAR NONNULLVALUE NOW NTILE NULLVALUE NVARCHAR NVARCHARCAT NYSIIS OVERLAPS PERCENTILE_CONT PERCENTILE_DISC PERCENTILE_RANK PI PRI_MP QUOTE_IDENT QUOTE_LITERAL RANDOM RANK ROW_NUMBER SCORE_MP SEC_MP SESSION_USER SETSEED ST_GEOMETRY STDDEV_POP STDDEV_SAMP STRING_FROM_HEX STRPOS TEXT Composed by Mark Mulligan Page 10 of 11 Friday, March 1, 2013 DB2 LUW SQL Functions Compared To Netezza SQL Functions TIMENOW TIMEOFDAY TIMESTAMP_CMP TIMESTAMP_TO_LOCALTIME TIMETZ TIMEZONE UNICHR UNICODE UNICODES UTF8CODES VARIANCE_POP VARIANCE_SAMP VERSION WIDTH_BUCKET Composed by Mark Mulligan Page 11 of 11 Friday, March 1, 2013